﻿namespace WMS6.BLL
{
    using System;
    using System.Collections.Generic;
    using System.Data;
    using WMS6.Common;
    using WMS6.DataEntity;
    using WMS6.IDAL;
    using WMS6.QueryEntity;
    using WMS6.DALFactory;

    public class AnalyticsReportBLL
    {
        private static readonly IAnalyticsReportDA analyticsReportDA = DataAccess.CreateAnalyticsReportDA();
        private static readonly ICommonMethodDA commonMethod = DataAccess.CreateCommonMethod();
        private static readonly ICustomerDA customerDA = DataAccess.CreateCustomerDA();
        private static readonly IDailyInvLocSkytransDA dailyInvLocSkytransDA = DataAccess.CreateDailyInvLocSkytransDA();
        private List<string> dataBaseID;
        private static readonly IGlobalSettingDA globalSettingDA = DataAccess.CreateGlobalSettingDA();
        private PubParasInfo pubParasInfo;

        public AnalyticsReportBLL()
        {
            this.pubParasInfo = null;
        }

        public AnalyticsReportBLL(string currentWH)
        {
            this.pubParasInfo = null;
            if (!string.IsNullOrEmpty(currentWH))
            {
                this.dataBaseID = commonMethod.GetDataBaseID(currentWH);
                if (this.dataBaseID == null)
                {
                    PublicMethod.GetInstance().ShowAlertMessage("C001");
                }
            }
            else
            {
                PublicMethod.GetInstance().ShowAlertMessage("C002");
            }
        }

        public AnalyticsReportBLL(PubParasInfo tempPubParasInfo)
        {
            this.pubParasInfo = null;
            if (!string.IsNullOrEmpty(tempPubParasInfo.CurrentWH))
            {
                this.dataBaseID = commonMethod.GetDataBaseID(tempPubParasInfo.CurrentWH);
                if (this.dataBaseID == null)
                {
                    PublicMethod.GetInstance().ShowAlertMessage("C001", this.pubParasInfo.UserLanguage);
                }
                else
                {
                    this.pubParasInfo = new PubParasInfo();
                    this.pubParasInfo = tempPubParasInfo;
                }
            }
            else
            {
                PublicMethod.GetInstance().ShowAlertMessage("C002", this.pubParasInfo.UserLanguage);
            }
        }

        public DataSet GetAdjustMentRptDataSet(InvAdjustmentRptQueryEntity invAdjustmentRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(invAdjustmentRptQueryEntity.ADJUSTMENT_ID))
            {
                sqlWhere.Add(" A.ADJUSTMENT_ID " + invAdjustmentRptQueryEntity.ADJUSTMENT_ID);
            }
            if (!string.IsNullOrEmpty(invAdjustmentRptQueryEntity.OWNER_ID))
            {
                sqlWhere.Add(" A.OWNER_ID " + invAdjustmentRptQueryEntity.OWNER_ID);
            }
            if (!string.IsNullOrEmpty(invAdjustmentRptQueryEntity.SKU_ID))
            {
                sqlWhere.Add(" A.SKU_ID " + invAdjustmentRptQueryEntity.SKU_ID);
            }
            if (!string.IsNullOrEmpty(invAdjustmentRptQueryEntity.SKUCLASS_ID))
            {
                sqlWhere.Add("C.SKU_CLASS_ID " + invAdjustmentRptQueryEntity.SKUCLASS_ID);
            }
            if (!string.IsNullOrEmpty(invAdjustmentRptQueryEntity.DESCR))
            {
                sqlWhere.Add("C.DESCR " + invAdjustmentRptQueryEntity.DESCR);
            }
            if (!string.IsNullOrEmpty(invAdjustmentRptQueryEntity.LOC))
            {
                sqlWhere.Add("A.LOC " + invAdjustmentRptQueryEntity.LOC);
            }
            if (!string.IsNullOrEmpty(invAdjustmentRptQueryEntity.LOT))
            {
                sqlWhere.Add("A.LOT " + invAdjustmentRptQueryEntity.LOT);
            }
            if (!string.IsNullOrEmpty(invAdjustmentRptQueryEntity.REASON_CODE.Trim()))
            {
                sqlWhere.Add("A.REASON_CODE " + invAdjustmentRptQueryEntity.REASON_CODE);
            }
            if (!string.IsNullOrEmpty(invAdjustmentRptQueryEntity.ADJUSTMENT_DATE))
            {
                sqlWhere.Add("A.ADJUSTMENT_DATE " + invAdjustmentRptQueryEntity.ADJUSTMENT_DATE);
            }
            if (!string.IsNullOrEmpty(invAdjustmentRptQueryEntity.EXTERNAL_LOT))
            {
                sqlWhere.Add("F.EXTERNAL_LOT " + invAdjustmentRptQueryEntity.EXTERNAL_LOT);
            }
            if (!string.IsNullOrEmpty(invAdjustmentRptQueryEntity.LOT_ATTR01))
            {
                sqlWhere.Add(" F.LOT_ATTR01 " + invAdjustmentRptQueryEntity.LOT_ATTR01);
            }
            if (!string.IsNullOrEmpty(invAdjustmentRptQueryEntity.LOT_ATTR02))
            {
                sqlWhere.Add(" F.LOT_ATTR02" + invAdjustmentRptQueryEntity.LOT_ATTR02);
            }
            if (!string.IsNullOrEmpty(invAdjustmentRptQueryEntity.LOT_ATTR03))
            {
                sqlWhere.Add(" F.LOT_ATTR03" + invAdjustmentRptQueryEntity.LOT_ATTR03);
            }
            if (!string.IsNullOrEmpty(invAdjustmentRptQueryEntity.LOT_ATTR04))
            {
                sqlWhere.Add(" F.LOT_ATTR04" + invAdjustmentRptQueryEntity.LOT_ATTR04);
            }
            if (!string.IsNullOrEmpty(invAdjustmentRptQueryEntity.LOT_ATTR05))
            {
                sqlWhere.Add(" F.LOT_ATTR05" + invAdjustmentRptQueryEntity.LOT_ATTR05);
            }
            if (!string.IsNullOrEmpty(invAdjustmentRptQueryEntity.LOT_ATTR06))
            {
                sqlWhere.Add(" F.LOT_ATTR06" + invAdjustmentRptQueryEntity.LOT_ATTR06);
            }
            if (!string.IsNullOrEmpty(invAdjustmentRptQueryEntity.LOT_ATTR07))
            {
                sqlWhere.Add(" F.LOT_ATTR07" + invAdjustmentRptQueryEntity.LOT_ATTR07);
            }
            if (!string.IsNullOrEmpty(invAdjustmentRptQueryEntity.LOT_ATTR08))
            {
                sqlWhere.Add(" F.LOT_ATTR08" + invAdjustmentRptQueryEntity.LOT_ATTR08);
            }
            if (!string.IsNullOrEmpty(invAdjustmentRptQueryEntity.LOT_ATTR09))
            {
                sqlWhere.Add(" F.LOT_ATTR09" + invAdjustmentRptQueryEntity.LOT_ATTR09);
            }
            if (!string.IsNullOrEmpty(invAdjustmentRptQueryEntity.LOT_ATTR10))
            {
                sqlWhere.Add(" F.LOT_ATTR10" + invAdjustmentRptQueryEntity.LOT_ATTR10);
            }
            if (!string.IsNullOrEmpty(invAdjustmentRptQueryEntity.PRODUCE_DATE))
            {
                sqlWhere.Add(invAdjustmentRptQueryEntity.PRODUCE_DATE.Replace("@ProduceDate@", " F.PRODUCE_DATE "));
            }
            if (!string.IsNullOrEmpty(invAdjustmentRptQueryEntity.EXPIRY_DATE))
            {
                sqlWhere.Add(invAdjustmentRptQueryEntity.EXPIRY_DATE.Replace("@ExpiryDate@", " F.EXPIRY_DATE "));
            }
            return analyticsReportDA.GetAdjustMentRptDataSet(sqlWhere, invAdjustmentRptQueryEntity, this.pubParasInfo, this.dataBaseID[0]);
        }

        public DataSet GetASNStatusRptInfo(ASNStatusRptQueryEntity asnStatusRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(asnStatusRptQueryEntity.RECEIPT_ID))
            {
                sqlWhere.Add(" RECEIPT_ID " + asnStatusRptQueryEntity.RECEIPT_ID);
            }
            if (!string.IsNullOrEmpty(asnStatusRptQueryEntity.PO_ID))
            {
                sqlWhere.Add(" PO_ID " + asnStatusRptQueryEntity.PO_ID);
            }
            if (!string.IsNullOrEmpty(asnStatusRptQueryEntity.OWNER_ID))
            {
                sqlWhere.Add(" TEMP.OWNER_ID " + asnStatusRptQueryEntity.OWNER_ID);
            }
            if (!string.IsNullOrEmpty(asnStatusRptQueryEntity.DESCR))
            {
                sqlWhere.Add(" DESCR " + asnStatusRptQueryEntity.DESCR);
            }
            if (!string.IsNullOrEmpty(asnStatusRptQueryEntity.SKU_CLASS_ID))
            {
                sqlWhere.Add(" SKU_CLASS_ID " + asnStatusRptQueryEntity.SKU_CLASS_ID);
            }
            if (!string.IsNullOrEmpty(asnStatusRptQueryEntity.EXTERN_RECEIPT_ID))
            {
                sqlWhere.Add(" EXTERNAL_RECEIPT_ID " + asnStatusRptQueryEntity.EXTERN_RECEIPT_ID);
            }
            if (!string.IsNullOrEmpty(asnStatusRptQueryEntity.RECEIPT_TYPE))
            {
                sqlWhere.Add(" RECEIPT_TYPE " + asnStatusRptQueryEntity.RECEIPT_TYPE);
            }
            if (!string.IsNullOrEmpty(asnStatusRptQueryEntity.STARTRECEIVED_DATE))
            {
                sqlWhere.Add(" RECEIPT_DATE >= '" + asnStatusRptQueryEntity.STARTRECEIVED_DATE + "'");
            }
            if (!string.IsNullOrEmpty(asnStatusRptQueryEntity.ENDRECEIVED_DATE))
            {
                sqlWhere.Add("  RECEIPT_DATE <= '" + asnStatusRptQueryEntity.ENDRECEIVED_DATE + "'");
            }
            if (!string.IsNullOrEmpty(asnStatusRptQueryEntity.VENDOR_ID))
            {
                sqlWhere.Add(" VENDOR_ID " + asnStatusRptQueryEntity.VENDOR_ID);
            }
            if (!string.IsNullOrEmpty(asnStatusRptQueryEntity.STATUS))
            {
                sqlWhere.Add(" STATUS " + asnStatusRptQueryEntity.STATUS);
            }
            return analyticsReportDA.GetASNStatusRptInfo(sqlWhere, asnStatusRptQueryEntity, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetBillingLoadDetailRptDataSet(BillingLoadDetailRptQueryEntity billingLoadDetailRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            List<string> sqlWhere2 = new List<string>();
            if (!string.IsNullOrEmpty(billingLoadDetailRptQueryEntity.DOC_TYPE))
            {
                sqlWhere.Add(" BC.DOC_TYPE " + billingLoadDetailRptQueryEntity.DOC_TYPE);
            }
            if (!string.IsNullOrEmpty(billingLoadDetailRptQueryEntity.DOC_ID))
            {
                sqlWhere.Add(" BC.DOC_ID " + billingLoadDetailRptQueryEntity.DOC_ID);
            }
            if (!string.IsNullOrEmpty(billingLoadDetailRptQueryEntity.EXTERNAL_DOC_ID))
            {
                sqlWhere.Add(" BC.EXTERNAL_DOC_ID " + billingLoadDetailRptQueryEntity.EXTERNAL_DOC_ID);
            }
            if (!string.IsNullOrEmpty(billingLoadDetailRptQueryEntity.COST_TYPE))
            {
                sqlWhere.Add(" BC.COST_TYPE " + billingLoadDetailRptQueryEntity.COST_TYPE);
            }
            if (!string.IsNullOrEmpty(billingLoadDetailRptQueryEntity.DUE_FROM_TO))
            {
                sqlWhere.Add(" BC.DUE_FROM_TO " + billingLoadDetailRptQueryEntity.DUE_FROM_TO);
            }
            if (!string.IsNullOrEmpty(billingLoadDetailRptQueryEntity.IS_HOLIDAY))
            {
                sqlWhere.Add(" MPR.IS_HOLIDAY " + billingLoadDetailRptQueryEntity.IS_HOLIDAY);
            }
            if (!string.IsNullOrEmpty(billingLoadDetailRptQueryEntity.OWNER_ID))
            {
                sqlWhere.Add(" BC.OWNER_ID " + billingLoadDetailRptQueryEntity.OWNER_ID);
            }
            if (!string.IsNullOrEmpty(billingLoadDetailRptQueryEntity.EMPLOYEE_ID))
            {
                sqlWhere.Add(" E.EMPLOYEE_ID " + billingLoadDetailRptQueryEntity.EMPLOYEE_ID);
            }
            if (!string.IsNullOrEmpty(billingLoadDetailRptQueryEntity.WORK_CLASS))
            {
                sqlWhere.Add(" WC.WORK_CLASS_ID " + billingLoadDetailRptQueryEntity.WORK_CLASS);
            }
            if (!string.IsNullOrEmpty(billingLoadDetailRptQueryEntity.IS_PRINTED))
            {
                sqlWhere2.Add(" IS_PRINTED " + billingLoadDetailRptQueryEntity.IS_PRINTED);
            }
            if (!string.IsNullOrEmpty(billingLoadDetailRptQueryEntity.StartDateTime))
            {
                sqlWhere2.Add(" CREATED_DATE >= '" + Convert.ToDateTime(billingLoadDetailRptQueryEntity.StartDateTime).ToString("yyyy-MM-dd") + " 00:00:00'");
            }
            if (!string.IsNullOrEmpty(billingLoadDetailRptQueryEntity.EndDateTime))
            {
                sqlWhere2.Add(" CREATED_DATE <= '" + Convert.ToDateTime(billingLoadDetailRptQueryEntity.EndDateTime).ToString("yyyy-MM-dd") + " 23:59:29'");
            }
            return analyticsReportDA.GetBillingLoadDetailRptDataSet(sqlWhere, sqlWhere2, billingLoadDetailRptQueryEntity, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetBillingProfitRptDataSet(InvoiceRptQueryEntity invoiceRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(invoiceRptQueryEntity.DUE_FROM_TO))
            {
                sqlWhere.Add(" DUE_FROM_TO " + invoiceRptQueryEntity.DUE_FROM_TO);
            }
            if (!string.IsNullOrEmpty(invoiceRptQueryEntity.BILLING_OBJECT))
            {
                sqlWhere.Add(" BILLING_OBJECT " + invoiceRptQueryEntity.BILLING_OBJECT);
            }
            if (!string.IsNullOrEmpty(invoiceRptQueryEntity.BILLING_OBJECT_ID))
            {
                sqlWhere.Add(" BILLING_OBJECT_ID " + invoiceRptQueryEntity.BILLING_OBJECT_ID);
            }
            if (!string.IsNullOrEmpty(invoiceRptQueryEntity.StartDateTime))
            {
                sqlWhere.Add(" CREATED_DATE >= '" + Convert.ToDateTime(invoiceRptQueryEntity.StartDateTime).ToString("yyyy-MM-dd") + " 00:00:00'");
            }
            if (!string.IsNullOrEmpty(invoiceRptQueryEntity.EndDateTime))
            {
                sqlWhere.Add(" CREATED_DATE <= '" + Convert.ToDateTime(invoiceRptQueryEntity.EndDateTime).ToString("yyyy-MM-dd") + " 23:59:59'");
            }
            return analyticsReportDA.GetBillingProfitRptDataSet(sqlWhere, invoiceRptQueryEntity, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetContractRptDataSet(ContractRptQueryEntity contractRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(contractRptQueryEntity.OwnerID))
            {
                sqlWhere.Add(" C.OWNER_ID " + contractRptQueryEntity.OwnerID);
            }
            if (!string.IsNullOrEmpty(contractRptQueryEntity.IsAudit))
            {
                sqlWhere.Add(" C.IS_AUDIT " + contractRptQueryEntity.IsAudit);
            }
            GlobalSettingInfo globalSettingInfo = globalSettingDA.GetGlobalSettingByID("CONTRACT_EXPIRE_REMINDER_DAYS");
            if (globalSettingInfo != null)
            {
                contractRptQueryEntity.ReminderDays = globalSettingInfo.Value;
            }
            else
            {
                contractRptQueryEntity.ReminderDays = "0";
            }
            return analyticsReportDA.GetContractRptDataSet(sqlWhere, contractRptQueryEntity, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetCustomerReturnDetailRptDataSet(CustomerReturnDetailRptQueryEntity customerReturnDetailRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(customerReturnDetailRptQueryEntity.OWNER_ID))
            {
                sqlWhere.Add(" OWNER_ID " + customerReturnDetailRptQueryEntity.OWNER_ID);
            }
            if (!string.IsNullOrEmpty(customerReturnDetailRptQueryEntity.SKU_CLASS))
            {
                sqlWhere.Add(" SKU_CLASS_ID " + customerReturnDetailRptQueryEntity.SKU_CLASS);
            }
            if (!string.IsNullOrEmpty(customerReturnDetailRptQueryEntity.SKU_ID))
            {
                sqlWhere.Add(" SKU_ID " + customerReturnDetailRptQueryEntity.SKU_ID);
            }
            if (!string.IsNullOrEmpty(customerReturnDetailRptQueryEntity.SKU_DESCR))
            {
                sqlWhere.Add(" SKU_DESCR " + customerReturnDetailRptQueryEntity.SKU_DESCR);
            }
            if (!string.IsNullOrEmpty(customerReturnDetailRptQueryEntity.CUSTOMER_ID))
            {
                sqlWhere.Add(" VENDOR_ID " + customerReturnDetailRptQueryEntity.CUSTOMER_ID);
            }
            if (!string.IsNullOrEmpty(customerReturnDetailRptQueryEntity.CUSTOMER_NAME))
            {
                sqlWhere.Add(" VENDOR_NAME " + customerReturnDetailRptQueryEntity.CUSTOMER_NAME);
            }
            if (!string.IsNullOrEmpty(customerReturnDetailRptQueryEntity.StartDateTime))
            {
                sqlWhere.Add(" RECEIPT_DATE >= '" + customerReturnDetailRptQueryEntity.StartDateTime + "'");
            }
            if (!string.IsNullOrEmpty(customerReturnDetailRptQueryEntity.EndDateTime))
            {
                sqlWhere.Add(" RECEIPT_DATE <= '" + customerReturnDetailRptQueryEntity.EndDateTime + "'");
            }
            return analyticsReportDA.GetCustomerReturnDetailRptDataSet(sqlWhere, customerReturnDetailRptQueryEntity, this.pubParasInfo, this.dataBaseID[0]);
        }

        public DataSet GetDailyInvPalletRptDataSet(DailyInvPalletRptQueryEntity dailyInvPalletRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(dailyInvPalletRptQueryEntity.OWNER_ID))
            {
                sqlWhere.Add(" IP.OWNER_ID " + dailyInvPalletRptQueryEntity.OWNER_ID);
            }
            if (!string.IsNullOrEmpty(dailyInvPalletRptQueryEntity.SKU_ID))
            {
                sqlWhere.Add(" IP.SKU_ID " + dailyInvPalletRptQueryEntity.SKU_ID);
            }
            if (string.IsNullOrEmpty(dailyInvPalletRptQueryEntity.StartDateTime))
            {
                dailyInvPalletRptQueryEntity.StartDateTime = "2000-01-01";
            }
            else
            {
                dailyInvPalletRptQueryEntity.StartDateTime = Convert.ToDateTime(dailyInvPalletRptQueryEntity.StartDateTime).ToString("yyyy-MM-dd");
            }
            if (string.IsNullOrEmpty(dailyInvPalletRptQueryEntity.EndDateTime))
            {
                dailyInvPalletRptQueryEntity.EndDateTime = DateTime.Now.ToString("yyyy-MM-dd");
            }
            else
            {
                dailyInvPalletRptQueryEntity.EndDateTime = Convert.ToDateTime(dailyInvPalletRptQueryEntity.EndDateTime).ToString("yyyy-MM-dd");
            }
            return analyticsReportDA.GetDailyInvPalletRptDataSet(sqlWhere, dailyInvPalletRptQueryEntity, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetDeclarationEarlyWarningRptDataSet(DeclarationEarlyWarningRptQueryEntity declarationEarlyWarningRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            return analyticsReportDA.GetDeclarationEarlyWarningRptDataSet(sqlWhere, declarationEarlyWarningRptQueryEntity, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetDeclarationsBlanaceRptDataSet(DeclarationsBlanaceRptQueryEntity declarationsBlanaceRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(declarationsBlanaceRptQueryEntity.OwnerID))
            {
                sqlWhere.Add(" A.OWNER_ID " + declarationsBlanaceRptQueryEntity.OwnerID);
            }
            if (!string.IsNullOrEmpty(declarationsBlanaceRptQueryEntity.SkuID))
            {
                sqlWhere.Add(" A.SKU_ID " + declarationsBlanaceRptQueryEntity.SkuID);
            }
            if (!string.IsNullOrEmpty(declarationsBlanaceRptQueryEntity.ItemNoID))
            {
                sqlWhere.Add(" A.ITEM_NO_ID " + declarationsBlanaceRptQueryEntity.ItemNoID);
            }
            return analyticsReportDA.GetDeclarationsBlanaceRptDataSet(sqlWhere, declarationsBlanaceRptQueryEntity, this.pubParasInfo, this.dataBaseID[0]);
        }

        public DataSet GetDeclarationsInOutDetailRptDataSet(DeclarationsInOutDetailRptQueryEntity declarationsInOutDetailRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(declarationsInOutDetailRptQueryEntity.DeclarationsID))
            {
                sqlWhere.Add(" A.IN_DECLARATIONS_ID " + declarationsInOutDetailRptQueryEntity.DeclarationsID);
            }
            if (!string.IsNullOrEmpty(declarationsInOutDetailRptQueryEntity.CompanyDeclarationgsID))
            {
                sqlWhere.Add(" A.COMPANY_DECLARATIONGS_ID " + declarationsInOutDetailRptQueryEntity.CompanyDeclarationgsID);
            }
            if (!string.IsNullOrEmpty(declarationsInOutDetailRptQueryEntity.OwnerID))
            {
                sqlWhere.Add(" A.OWNER_ID " + declarationsInOutDetailRptQueryEntity.OwnerID);
            }
            if (!string.IsNullOrEmpty(declarationsInOutDetailRptQueryEntity.SkuID))
            {
                sqlWhere.Add(" A.SKU_ID " + declarationsInOutDetailRptQueryEntity.SkuID);
            }
            if (!string.IsNullOrEmpty(declarationsInOutDetailRptQueryEntity.DeclarationsDate))
            {
                sqlWhere.Add(declarationsInOutDetailRptQueryEntity.DeclarationsDate.Replace("@DeclarationsDate@", "ED.DECLARATIONS_DATE"));
            }
            DataSet ds = analyticsReportDA.GetDeclarationsInOutDetailRptDataSet(sqlWhere, declarationsInOutDetailRptQueryEntity, this.pubParasInfo, this.dataBaseID[0]);
            try
            {
                int i;
                if (ds == null)
                {
                    return ds;
                }
                string declarationID = string.Empty;
                string skuID = string.Empty;
                if (((ds.Tables.Count > 2) && (ds.Tables[2] != null)) && (ds.Tables[2].Rows.Count > 0))
                {
                    for (i = 0; ds.Tables[2].Rows.Count > i; i++)
                    {
                        if (((i + 1) < ds.Tables[2].Rows.Count) && ((ds.Tables[2].Rows[i]["IN_DECLARATIONS_ID"].ToString() == ds.Tables[2].Rows[i + 1]["IN_DECLARATIONS_ID"].ToString()) && (ds.Tables[2].Rows[i]["SKU_ID"].ToString() == ds.Tables[2].Rows[i + 1]["SKU_ID"].ToString())))
                        {
                            ds.Tables[2].Rows[i]["IN_QTY"] = "";
                            ds.Tables[2].Rows[i]["RemainingQty"] = "";
                        }
                        if (ds.Tables[2].Rows[i]["IN_DECLARATIONS_ID"].ToString() != declarationID)
                        {
                            declarationID = ds.Tables[2].Rows[i]["IN_DECLARATIONS_ID"].ToString();
                            skuID = ds.Tables[2].Rows[i]["SKU_ID"].ToString();
                        }
                        else
                        {
                            ds.Tables[2].Rows[i]["IN_DECLARATIONS_ID"] = "";
                            ds.Tables[2].Rows[i]["COMPANY_DECLARATIONGS_ID"] = "";
                            ds.Tables[2].Rows[i]["IN_DECLARATIONS_DATE"] = "";
                            if (ds.Tables[2].Rows[i]["SKU_ID"].ToString() != skuID)
                            {
                                skuID = ds.Tables[2].Rows[i]["SKU_ID"].ToString();
                            }
                            else
                            {
                                ds.Tables[2].Rows[i]["SKU_ID"] = "";
                                ds.Tables[2].Rows[i]["SKU_DESCR"] = "";
                                ds.Tables[2].Rows[i]["ITEM_NO_ID"] = "";
                                ds.Tables[2].Rows[i]["ITEM_DESCR"] = "";
                                ds.Tables[2].Rows[i]["UOM_DESCR"] = "";
                                ds.Tables[2].Rows[i]["COMPANY_DECLARATIONGS_ID"] = "";
                            }
                        }
                    }
                    return ds;
                }
                for (i = 0; ds.Tables[0].Rows.Count > i; i++)
                {
                    if (((i + 1) < ds.Tables[0].Rows.Count) && ((ds.Tables[0].Rows[i]["IN_DECLARATIONS_ID"].ToString() == ds.Tables[0].Rows[i + 1]["IN_DECLARATIONS_ID"].ToString()) && (ds.Tables[0].Rows[i]["SKU_ID"].ToString() == ds.Tables[0].Rows[i + 1]["SKU_ID"].ToString())))
                    {
                        ds.Tables[0].Rows[i]["IN_QTY"] = "";
                        ds.Tables[0].Rows[i]["RemainingQty"] = "";
                    }
                    if (ds.Tables[0].Rows[i]["IN_DECLARATIONS_ID"].ToString() != declarationID)
                    {
                        declarationID = ds.Tables[0].Rows[i]["IN_DECLARATIONS_ID"].ToString();
                        skuID = ds.Tables[0].Rows[i]["SKU_ID"].ToString();
                    }
                    else
                    {
                        ds.Tables[0].Rows[i]["IN_DECLARATIONS_ID"] = "";
                        ds.Tables[0].Rows[i]["COMPANY_DECLARATIONGS_ID"] = "";
                        ds.Tables[0].Rows[i]["IN_DECLARATIONS_DATE"] = "";
                        if (ds.Tables[0].Rows[i]["SKU_ID"].ToString() != skuID)
                        {
                            skuID = ds.Tables[0].Rows[i]["SKU_ID"].ToString();
                        }
                        else
                        {
                            ds.Tables[0].Rows[i]["SKU_ID"] = "";
                            ds.Tables[0].Rows[i]["SKU_DESCR"] = "";
                            ds.Tables[0].Rows[i]["ITEM_NO_ID"] = "";
                            ds.Tables[0].Rows[i]["ITEM_DESCR"] = "";
                            ds.Tables[0].Rows[i]["UOM_DESCR"] = "";
                            ds.Tables[0].Rows[i]["COMPANY_DECLARATIONGS_ID"] = "";
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return ds;
        }

        public DataSet GetDeclarationsItemNoBlanaceRptDataSet(DeclarationsItemNoBlanaceRptQueryEntity declarationsItemNoBlanaceRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(declarationsItemNoBlanaceRptQueryEntity.ItemNoID))
            {
                sqlWhere.Add(" A.ITEM_NO_ID " + declarationsItemNoBlanaceRptQueryEntity.ItemNoID);
            }
            return analyticsReportDA.GetDeclarationsItemNoBlanaceRptDataSet(sqlWhere, declarationsItemNoBlanaceRptQueryEntity, this.pubParasInfo, this.dataBaseID[0]);
        }

        public DataSet GetDeliveryOrderRptDataSet(DeliveryOrderRptQueryEntity deliveryOrderRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(deliveryOrderRptQueryEntity.DeliveryOrderID))
            {
                sqlWhere.Add(" DO.DELIVERY_ORDER_ID " + deliveryOrderRptQueryEntity.DeliveryOrderID);
            }
            if (!string.IsNullOrEmpty(deliveryOrderRptQueryEntity.ExternOrderId2))
            {
                sqlWhere.Add(" DO.EXTERN_ORDER_ID2 " + deliveryOrderRptQueryEntity.ExternOrderId2);
            }
            if (!string.IsNullOrEmpty(deliveryOrderRptQueryEntity.OwnerID))
            {
                sqlWhere.Add(" DO.OWNER_ID " + deliveryOrderRptQueryEntity.OwnerID);
            }
            if (!string.IsNullOrEmpty(deliveryOrderRptQueryEntity.CustomerID))
            {
                sqlWhere.Add(" DO.CUSTOMER_ID " + deliveryOrderRptQueryEntity.CustomerID);
            }
            if (!string.IsNullOrEmpty(deliveryOrderRptQueryEntity.Status))
            {
                sqlWhere.Add(" DO.STATUS " + deliveryOrderRptQueryEntity.Status);
            }
            if (!string.IsNullOrEmpty(deliveryOrderRptQueryEntity.Receipted))
            {
                sqlWhere.Add(" DO.RECEIPTED " + deliveryOrderRptQueryEntity.Receipted);
            }
            if (!string.IsNullOrEmpty(deliveryOrderRptQueryEntity.CreatedBy))
            {
                sqlWhere.Add(" DO.CREATED_BY " + deliveryOrderRptQueryEntity.CreatedBy);
            }
            if (!string.IsNullOrEmpty(deliveryOrderRptQueryEntity.BeginDate))
            {
                sqlWhere.Add(" DO.CREATED_DATE >= '" + Convert.ToDateTime(deliveryOrderRptQueryEntity.BeginDate).ToString("yyyy-MM-dd") + " 00:00:00'");
            }
            if (!string.IsNullOrEmpty(deliveryOrderRptQueryEntity.EndDate))
            {
                sqlWhere.Add(" DO.CREATED_DATE <= '" + Convert.ToDateTime(deliveryOrderRptQueryEntity.EndDate).ToString("yyyy-MM-dd") + " 23:59:59'");
            }
            return analyticsReportDA.GetDeliveryOrderRptDataSet(sqlWhere, deliveryOrderRptQueryEntity, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetDiffCountReportList(DiffCountRptQueryEntity diffCountRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(diffCountRptQueryEntity.OwnerID))
            {
                sqlWhere.Add(" ILLL.OWNER_ID " + diffCountRptQueryEntity.OwnerID);
            }
            if (!string.IsNullOrEmpty(diffCountRptQueryEntity.SkuID))
            {
                sqlWhere.Add(" ILLL.SKU_ID " + diffCountRptQueryEntity.SkuID);
            }
            if (!string.IsNullOrEmpty(diffCountRptQueryEntity.SkuClassID))
            {
                sqlWhere.Add(" S.SKU_CLASS_ID " + diffCountRptQueryEntity.SkuClassID);
            }
            if (!string.IsNullOrEmpty(diffCountRptQueryEntity.StartLoc))
            {
                sqlWhere.Add(" ILLL.LOC " + diffCountRptQueryEntity.StartLoc);
            }
            if (!string.IsNullOrEmpty(diffCountRptQueryEntity.SkuDescr))
            {
                sqlWhere.Add(" S.DESCR " + diffCountRptQueryEntity.SkuDescr);
            }
            if (!string.IsNullOrEmpty(diffCountRptQueryEntity.ExternalLot))
            {
                sqlWhere.Add(" LA.EXTERNAL_LOT " + diffCountRptQueryEntity.ExternalLot);
            }
            if (!string.IsNullOrEmpty(diffCountRptQueryEntity.VendorID))
            {
                sqlWhere.Add(" LA.VENDOR_ID " + diffCountRptQueryEntity.VendorID);
            }
            if (!string.IsNullOrEmpty(diffCountRptQueryEntity.Lot))
            {
                sqlWhere.Add(" LA.LOT " + diffCountRptQueryEntity.Lot);
            }
            if (!string.IsNullOrEmpty(diffCountRptQueryEntity.LPN))
            {
                sqlWhere.Add(" ILLL.LPN_ID " + diffCountRptQueryEntity.LPN);
            }
            if (!string.IsNullOrEmpty(diffCountRptQueryEntity.ZoneID))
            {
                sqlWhere.Add(" L.ZONE_ID  " + diffCountRptQueryEntity.ZoneID);
            }
            sqlWhere.Add(" ILLL.QTY > 0  ");
            return analyticsReportDA.GetDiffCountReportList(sqlWhere, diffCountRptQueryEntity, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetEmployeeWorkRptDataSet(EmployeeWorkRptQueryEntity employeeWorkRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(employeeWorkRptQueryEntity.EMPLOYEE_ID))
            {
                sqlWhere.Add(" MPR.STORE_MAN " + employeeWorkRptQueryEntity.EMPLOYEE_ID);
            }
            if (!string.IsNullOrEmpty(employeeWorkRptQueryEntity.StartDateTime))
            {
                sqlWhere.Add(" MPR.CREATED_DATE >= '" + Convert.ToDateTime(employeeWorkRptQueryEntity.StartDateTime).ToString("yyyy-MM-dd") + " 00:00:00'");
            }
            if (!string.IsNullOrEmpty(employeeWorkRptQueryEntity.EndDateTime))
            {
                sqlWhere.Add(" MPR.CREATED_DATE <= '" + Convert.ToDateTime(employeeWorkRptQueryEntity.EndDateTime).ToString("yyyy-MM-dd") + " 23:59:59'");
            }
            return analyticsReportDA.GetEmployeeWorkRptDataSet(sqlWhere, employeeWorkRptQueryEntity, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetEmptyLocationRptInfo(EmptyLocationRptQueryEntity emptyLocationRptQuery)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(emptyLocationRptQuery.LOC))
            {
                sqlWhere.Add(" LOC " + emptyLocationRptQuery.LOC);
            }
            if (!string.IsNullOrEmpty(emptyLocationRptQuery.ZONE_ID))
            {
                sqlWhere.Add(" ZONE_ID " + emptyLocationRptQuery.ZONE_ID);
            }
            if (!string.IsNullOrEmpty(emptyLocationRptQuery.LOC_USAGE))
            {
                sqlWhere.Add(" LOC_USAGE " + emptyLocationRptQuery.LOC_USAGE);
            }
            if (!string.IsNullOrEmpty(emptyLocationRptQuery.ABC))
            {
                sqlWhere.Add(" ABC " + emptyLocationRptQuery.ABC);
            }
            if (!string.IsNullOrEmpty(emptyLocationRptQuery.STATUS))
            {
                sqlWhere.Add(" STATUS " + emptyLocationRptQuery.STATUS);
            }
            if (!string.IsNullOrEmpty(emptyLocationRptQuery.LOC_FLAG))
            {
                sqlWhere.Add(" LOC_FLAG " + emptyLocationRptQuery.LOC_FLAG);
            }
            return analyticsReportDA.GetEmptyLocationRptInfo(sqlWhere, emptyLocationRptQuery, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetExportDeclarationsRptDateSet(ExportDeclarationsRptQueryEntity exportDeclarationsRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(exportDeclarationsRptQueryEntity.DeclarationsID))
            {
                sqlWhere.Add(" EDS.DECLARATIONS_ID " + exportDeclarationsRptQueryEntity.DeclarationsID);
            }
            if (!string.IsNullOrEmpty(exportDeclarationsRptQueryEntity.CompanyDeclarationsID))
            {
                sqlWhere.Add(" EDS.COMPANY_DECLARATIONGS_ID " + exportDeclarationsRptQueryEntity.CompanyDeclarationsID);
            }
            if (!string.IsNullOrEmpty(exportDeclarationsRptQueryEntity.CreatedBy))
            {
                sqlWhere.Add(" EDS.CREATED_BY " + exportDeclarationsRptQueryEntity.CreatedBy);
            }
            if (!string.IsNullOrEmpty(exportDeclarationsRptQueryEntity.OwnerID))
            {
                sqlWhere.Add(" EDS.OWNER_ID " + exportDeclarationsRptQueryEntity.OwnerID);
            }
            if (!string.IsNullOrEmpty(exportDeclarationsRptQueryEntity.OwnerOrderID))
            {
                sqlWhere.Add(" EDS.OWNER_ORDER_ID " + exportDeclarationsRptQueryEntity.OwnerOrderID);
            }
            if (!string.IsNullOrEmpty(exportDeclarationsRptQueryEntity.VerificationFormID))
            {
                sqlWhere.Add(" EDS.VERIFICATION_FORM_ID " + exportDeclarationsRptQueryEntity.VerificationFormID);
            }
            if (!string.IsNullOrEmpty(exportDeclarationsRptQueryEntity.Status))
            {
                sqlWhere.Add(" EDS.STATUS " + exportDeclarationsRptQueryEntity.Status);
            }
            if (!string.IsNullOrEmpty(exportDeclarationsRptQueryEntity.DeclarationsDate))
            {
                sqlWhere.Add(exportDeclarationsRptQueryEntity.DeclarationsDate.Replace("@DeclarationsDate@", "EDS.DECLARATIONS_DATE"));
            }
            sqlWhere.Add(" EDD.QTY>0 ");
            return analyticsReportDA.GetExportDeclarationsRptDateSet(sqlWhere, exportDeclarationsRptQueryEntity, this.pubParasInfo, this.dataBaseID[0]);
        }

        public DataSet GetFinanceInOutStockDetailRptDataSet(FinanceInOutStockDetailRptQueryEntity financeInOutStockDetailRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(financeInOutStockDetailRptQueryEntity.OwnerID))
            {
                sqlWhere.Add(" IL.OWNER_ID " + financeInOutStockDetailRptQueryEntity.OwnerID);
            }
            if (!string.IsNullOrEmpty(financeInOutStockDetailRptQueryEntity.SkuID))
            {
                sqlWhere.Add(" IL.SKU_ID " + financeInOutStockDetailRptQueryEntity.SkuID);
            }
            if (!string.IsNullOrEmpty(financeInOutStockDetailRptQueryEntity.SkuClassID))
            {
                sqlWhere.Add(" SC.SKU_CLASS_ID " + financeInOutStockDetailRptQueryEntity.SkuClassID);
            }
            if (!string.IsNullOrEmpty(financeInOutStockDetailRptQueryEntity.VendorID))
            {
                sqlWhere.Add(" LA.VENDOR_ID " + financeInOutStockDetailRptQueryEntity.VendorID);
            }
            if (!string.IsNullOrEmpty(financeInOutStockDetailRptQueryEntity.LOT_ATTR01))
            {
                sqlWhere.Add(" LA.LOT_ATTR01 " + financeInOutStockDetailRptQueryEntity.LOT_ATTR01);
            }
            if (!string.IsNullOrEmpty(financeInOutStockDetailRptQueryEntity.LOT_ATTR02))
            {
                sqlWhere.Add(" LA.LOT_ATTR02 " + financeInOutStockDetailRptQueryEntity.LOT_ATTR02);
            }
            if (!string.IsNullOrEmpty(financeInOutStockDetailRptQueryEntity.LOT_ATTR03))
            {
                sqlWhere.Add(" LA.LOT_ATTR03 " + financeInOutStockDetailRptQueryEntity.LOT_ATTR03);
            }
            if (!string.IsNullOrEmpty(financeInOutStockDetailRptQueryEntity.LOT_ATTR04))
            {
                sqlWhere.Add(" LA.LOT_ATTR04 " + financeInOutStockDetailRptQueryEntity.LOT_ATTR04);
            }
            if (!string.IsNullOrEmpty(financeInOutStockDetailRptQueryEntity.LOT_ATTR05))
            {
                sqlWhere.Add(" LA.LOT_ATTR05 " + financeInOutStockDetailRptQueryEntity.LOT_ATTR05);
            }
            if (!string.IsNullOrEmpty(financeInOutStockDetailRptQueryEntity.LOT_ATTR06))
            {
                sqlWhere.Add(" LA.LOT_ATTR06 " + financeInOutStockDetailRptQueryEntity.LOT_ATTR06);
            }
            if (!string.IsNullOrEmpty(financeInOutStockDetailRptQueryEntity.LOT_ATTR07))
            {
                sqlWhere.Add(" LA.LOT_ATTR07 " + financeInOutStockDetailRptQueryEntity.LOT_ATTR07);
            }
            if (!string.IsNullOrEmpty(financeInOutStockDetailRptQueryEntity.LOT_ATTR08))
            {
                sqlWhere.Add(" LA.LOT_ATTR08 " + financeInOutStockDetailRptQueryEntity.LOT_ATTR08);
            }
            if (!string.IsNullOrEmpty(financeInOutStockDetailRptQueryEntity.LOT_ATTR09))
            {
                sqlWhere.Add(" LA.LOT_ATTR09 " + financeInOutStockDetailRptQueryEntity.LOT_ATTR09);
            }
            if (!string.IsNullOrEmpty(financeInOutStockDetailRptQueryEntity.LOT_ATTR10))
            {
                sqlWhere.Add(" LA.LOT_ATTR10 " + financeInOutStockDetailRptQueryEntity.LOT_ATTR10);
            }
            return analyticsReportDA.GetFinanceInOutStockDetailRptDataSet(sqlWhere, financeInOutStockDetailRptQueryEntity, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetFinanceSalesDetailByDateRptDataSet(FinanceSalesDetailRptQueryEntiry financeSalesDetailRptQueryEntiry)
        {
            return analyticsReportDA.GetFinanceSalesDetailByDateRptDataSet(financeSalesDetailRptQueryEntiry, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetFinanceSalesDetailRptDataSet(FinanceSalesDetailRptQueryEntiry financeSalesDetailRptQueryEntiry)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(financeSalesDetailRptQueryEntiry.OwnerID))
            {
                sqlWhere.Add(" OD.OWNER_ID " + financeSalesDetailRptQueryEntiry.OwnerID);
            }
            if (!string.IsNullOrEmpty(financeSalesDetailRptQueryEntiry.CustomerID))
            {
                sqlWhere.Add(" [OR].CONSIGNEE_ID " + financeSalesDetailRptQueryEntiry.CustomerID);
            }
            if (!string.IsNullOrEmpty(financeSalesDetailRptQueryEntiry.SkuID))
            {
                sqlWhere.Add(" OD.SKU_ID " + financeSalesDetailRptQueryEntiry.SkuID);
            }
            if (!string.IsNullOrEmpty(financeSalesDetailRptQueryEntiry.StartDatetime))
            {
                sqlWhere.Add(" [OD].ACTUAL_SHIP_DATE   >= '" + financeSalesDetailRptQueryEntiry.StartDatetime + "'");
            }
            if (!string.IsNullOrEmpty(financeSalesDetailRptQueryEntiry.EndDatetime))
            {
                sqlWhere.Add(" [OD].ACTUAL_SHIP_DATE <= '" + financeSalesDetailRptQueryEntiry.EndDatetime + "'");
            }
            return analyticsReportDA.GetFinanceSalesDetailRptDataSet(sqlWhere, financeSalesDetailRptQueryEntiry, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetGlobalHistoryStockRptDataSet(HistoryStockRptQueryEntity historyStockRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.OWNER_ID))
            {
                sqlWhere.Add(" INV.OWNER_ID " + historyStockRptQueryEntity.OWNER_ID);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.SKU_ID))
            {
                sqlWhere.Add(" INV.SKU_ID " + historyStockRptQueryEntity.SKU_ID);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.DESCR))
            {
                sqlWhere.Add(" SKU.DESCR " + historyStockRptQueryEntity.DESCR);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.SKU_CLASS_ID))
            {
                sqlWhere.Add(" SKU.SKU_CLASS_ID " + historyStockRptQueryEntity.SKU_CLASS_ID);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.VENDOR_ID))
            {
                sqlWhere.Add(" INV.VENDOR_ID " + historyStockRptQueryEntity.VENDOR_ID);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.EXTERNAL_LOT))
            {
                sqlWhere.Add(" LA.EXTERNAL_LOT " + historyStockRptQueryEntity.EXTERNAL_LOT);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.LOT))
            {
                sqlWhere.Add(" INV.LOT " + historyStockRptQueryEntity.LOT);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.LOC_ID))
            {
                sqlWhere.Add(" INV.LOC " + historyStockRptQueryEntity.LOC_ID);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.LPN_ID))
            {
                sqlWhere.Add(" INV.LPN_ID " + historyStockRptQueryEntity.LPN_ID);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.LOT_ATTR01))
            {
                sqlWhere.Add(" LA.LOT_ATTR01 " + historyStockRptQueryEntity.LOT_ATTR01);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.LOT_ATTR02))
            {
                sqlWhere.Add(" LA.LOT_ATTR02" + historyStockRptQueryEntity.LOT_ATTR02);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.LOT_ATTR03))
            {
                sqlWhere.Add(" LA.LOT_ATTR03" + historyStockRptQueryEntity.LOT_ATTR03);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.LOT_ATTR04))
            {
                sqlWhere.Add(" LA.LOT_ATTR04" + historyStockRptQueryEntity.LOT_ATTR04);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.LOT_ATTR05))
            {
                sqlWhere.Add(" LA.LOT_ATTR05" + historyStockRptQueryEntity.LOT_ATTR05);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.LOT_ATTR06))
            {
                sqlWhere.Add(" LA.LOT_ATTR06" + historyStockRptQueryEntity.LOT_ATTR06);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.LOT_ATTR07))
            {
                sqlWhere.Add(" LA.LOT_ATTR07" + historyStockRptQueryEntity.LOT_ATTR07);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.LOT_ATTR08))
            {
                sqlWhere.Add(" LA.LOT_ATTR08" + historyStockRptQueryEntity.LOT_ATTR08);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.LOT_ATTR09))
            {
                sqlWhere.Add(" LA.LOT_ATTR09" + historyStockRptQueryEntity.LOT_ATTR09);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.LOT_ATTR10))
            {
                sqlWhere.Add(" LA.LOT_ATTR10" + historyStockRptQueryEntity.LOT_ATTR10);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.PRODUCE_DATE))
            {
                sqlWhere.Add(historyStockRptQueryEntity.PRODUCE_DATE.Replace("@ProduceDate@", " LA.PRODUCE_DATE "));
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.EXPIRY_DATE))
            {
                sqlWhere.Add(historyStockRptQueryEntity.EXPIRY_DATE.Replace("@ExpiryDate@", " LA.EXPIRY_DATE "));
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.RECEIPT_DATE))
            {
                sqlWhere.Add(historyStockRptQueryEntity.RECEIPT_DATE.Replace("@ReceiptDate@", " LA.RECEIPT_DATE "));
            }
            return analyticsReportDA.GetGlobalHistoryStockRptDataSet(sqlWhere, historyStockRptQueryEntity, historyStockRptQueryEntity.WH_IDS, this.pubParasInfo);
        }

        public DataSet GetGlobalInventoryRptDataSet(GlobalInventoryRptQueryEntity globalInventoryRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(globalInventoryRptQueryEntity.SKU_ID))
            {
                sqlWhere.Add(" A.SKU_ID " + globalInventoryRptQueryEntity.SKU_ID);
            }
            if (!string.IsNullOrEmpty(globalInventoryRptQueryEntity.DESCR))
            {
                sqlWhere.Add(" B.DESCR " + globalInventoryRptQueryEntity.DESCR);
            }
            if (!string.IsNullOrEmpty(globalInventoryRptQueryEntity.SKU_CLASS_ID))
            {
                sqlWhere.Add(" B.SKU_CLASS_ID " + globalInventoryRptQueryEntity.SKU_CLASS_ID);
            }
            if (!string.IsNullOrEmpty(globalInventoryRptQueryEntity.EXTERNAL_LOT))
            {
                sqlWhere.Add(" C.EXTERNAL_LOT " + globalInventoryRptQueryEntity.EXTERNAL_LOT);
            }
            if (!string.IsNullOrEmpty(globalInventoryRptQueryEntity.EXTERNAL_LOT))
            {
                sqlWhere.Add(" C.EXTERNAL_LOT " + globalInventoryRptQueryEntity.EXTERNAL_LOT);
            }
            if (!string.IsNullOrEmpty(globalInventoryRptQueryEntity.OWNER_ID))
            {
                sqlWhere.Add(" A.OWNER_ID " + globalInventoryRptQueryEntity.OWNER_ID);
            }
            if (!string.IsNullOrEmpty(globalInventoryRptQueryEntity.VENDOR_ID))
            {
                sqlWhere.Add(" C.VENDOR_ID " + globalInventoryRptQueryEntity.VENDOR_ID);
            }
            return analyticsReportDA.GetGlobalInventoryRptDataSet(sqlWhere, globalInventoryRptQueryEntity, globalInventoryRptQueryEntity.WhID, this.pubParasInfo);
        }

        public DataSet GetHistoryStockRptDataSet(HistoryStockRptQueryEntity historyStockRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.OWNER_ID))
            {
                sqlWhere.Add(" INV.OWNER_ID " + historyStockRptQueryEntity.OWNER_ID);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.SKU_ID))
            {
                sqlWhere.Add(" INV.SKU_ID " + historyStockRptQueryEntity.SKU_ID);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.DESCR))
            {
                sqlWhere.Add(" SKU.DESCR " + historyStockRptQueryEntity.DESCR);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.SKU_CLASS_ID))
            {
                sqlWhere.Add(" SKU.SKU_CLASS_ID " + historyStockRptQueryEntity.SKU_CLASS_ID);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.VENDOR_ID))
            {
                sqlWhere.Add(" INV.VENDOR_ID " + historyStockRptQueryEntity.VENDOR_ID);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.EXTERNAL_LOT))
            {
                sqlWhere.Add(" LA.EXTERNAL_LOT " + historyStockRptQueryEntity.EXTERNAL_LOT);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.LOT))
            {
                sqlWhere.Add(" INV.LOT " + historyStockRptQueryEntity.LOT);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.LOC_ID))
            {
                sqlWhere.Add(" INV.LOC " + historyStockRptQueryEntity.LOC_ID);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.LPN_ID))
            {
                sqlWhere.Add(" INV.LPN_ID " + historyStockRptQueryEntity.LPN_ID);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.LOT_ATTR01))
            {
                sqlWhere.Add(" LA.LOT_ATTR01 " + historyStockRptQueryEntity.LOT_ATTR01);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.LOT_ATTR02))
            {
                sqlWhere.Add(" LA.LOT_ATTR02" + historyStockRptQueryEntity.LOT_ATTR02);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.LOT_ATTR03))
            {
                sqlWhere.Add(" LA.LOT_ATTR03" + historyStockRptQueryEntity.LOT_ATTR03);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.LOT_ATTR04))
            {
                sqlWhere.Add(" LA.LOT_ATTR04" + historyStockRptQueryEntity.LOT_ATTR04);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.LOT_ATTR05))
            {
                sqlWhere.Add(" LA.LOT_ATTR05" + historyStockRptQueryEntity.LOT_ATTR05);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.LOT_ATTR06))
            {
                sqlWhere.Add(" LA.LOT_ATTR06" + historyStockRptQueryEntity.LOT_ATTR06);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.LOT_ATTR07))
            {
                sqlWhere.Add(" LA.LOT_ATTR07" + historyStockRptQueryEntity.LOT_ATTR07);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.LOT_ATTR08))
            {
                sqlWhere.Add(" LA.LOT_ATTR08" + historyStockRptQueryEntity.LOT_ATTR08);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.LOT_ATTR09))
            {
                sqlWhere.Add(" LA.LOT_ATTR09" + historyStockRptQueryEntity.LOT_ATTR09);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.LOT_ATTR10))
            {
                sqlWhere.Add(" LA.LOT_ATTR10" + historyStockRptQueryEntity.LOT_ATTR10);
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.PRODUCE_DATE))
            {
                sqlWhere.Add(historyStockRptQueryEntity.PRODUCE_DATE.Replace("@ProduceDate@", " LA.PRODUCE_DATE "));
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.EXPIRY_DATE))
            {
                sqlWhere.Add(historyStockRptQueryEntity.EXPIRY_DATE.Replace("@ExpiryDate@", " LA.EXPIRY_DATE "));
            }
            if (!string.IsNullOrEmpty(historyStockRptQueryEntity.RECEIPT_DATE))
            {
                sqlWhere.Add(historyStockRptQueryEntity.RECEIPT_DATE.Replace("@ReceiptDate@", " LA.RECEIPT_DATE "));
            }
            return analyticsReportDA.GetHistoryStockRptDataSet(sqlWhere, historyStockRptQueryEntity, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetIdleInventoryRptDataSet(IdleInventoryRptQueryEntiry idleInventoryRptQueryEntiry)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(idleInventoryRptQueryEntiry.OWNER_ID))
            {
                sqlWhere.Add(" ILLL.OWNER_ID " + idleInventoryRptQueryEntiry.OWNER_ID);
            }
            if (!string.IsNullOrEmpty(idleInventoryRptQueryEntiry.VENDOR_ID))
            {
                sqlWhere.Add(" LA.VENDOR_ID " + idleInventoryRptQueryEntiry.VENDOR_ID);
            }
            return analyticsReportDA.GetIdleInventoryRptDataSet(sqlWhere, idleInventoryRptQueryEntiry, this.pubParasInfo, this.dataBaseID[0]);
        }

        public DataSet GetImportDeclarationsRptDateSet(ImportDeclarationsRptQueryEntity importDeclarationsRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(importDeclarationsRptQueryEntity.DeclarationsID))
            {
                sqlWhere.Add(" IDS.DECLARATIONS_ID " + importDeclarationsRptQueryEntity.DeclarationsID);
            }
            if (!string.IsNullOrEmpty(importDeclarationsRptQueryEntity.CompanyDeclarationgsID))
            {
                sqlWhere.Add(" IDS.COMPANY_DECLARATIONGS_ID " + importDeclarationsRptQueryEntity.CompanyDeclarationgsID);
            }
            if (!string.IsNullOrEmpty(importDeclarationsRptQueryEntity.CreatedBy))
            {
                sqlWhere.Add(" IDS.CREATED_BY " + importDeclarationsRptQueryEntity.CreatedBy);
            }
            if (!string.IsNullOrEmpty(importDeclarationsRptQueryEntity.OwnerID))
            {
                sqlWhere.Add(" IDS.OWNER_ID " + importDeclarationsRptQueryEntity.OwnerID);
            }
            if (!string.IsNullOrEmpty(importDeclarationsRptQueryEntity.OwnerOrderID))
            {
                sqlWhere.Add(" IDS.OWNER_ORDER_ID " + importDeclarationsRptQueryEntity.OwnerOrderID);
            }
            if (!string.IsNullOrEmpty(importDeclarationsRptQueryEntity.VerificationFormID))
            {
                sqlWhere.Add(" IDS.VERIFICATION_FORM_ID " + importDeclarationsRptQueryEntity.VerificationFormID);
            }
            if (!string.IsNullOrEmpty(importDeclarationsRptQueryEntity.Status))
            {
                sqlWhere.Add(" IDS.STATUS " + importDeclarationsRptQueryEntity.Status);
            }
            if (!string.IsNullOrEmpty(importDeclarationsRptQueryEntity.DeclarationsDate))
            {
                sqlWhere.Add(importDeclarationsRptQueryEntity.DeclarationsDate.Replace("@DeclarationsDate@", "IDS.DECLARATIONS_DATE"));
            }
            sqlWhere.Add(" IDD.QTY>0 ");
            return analyticsReportDA.GetImportDeclarationsRptDateSet(sqlWhere, importDeclarationsRptQueryEntity, this.pubParasInfo, this.dataBaseID[0]);
        }

        public DataSet GetInOutBlanaceRptDataSet(InOutBlanaceRptQueryEntity inOutBlanaceRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(inOutBlanaceRptQueryEntity.OwnerID))
            {
                sqlWhere.Add(" IL.OWNER_ID " + inOutBlanaceRptQueryEntity.OwnerID);
            }
            if (!string.IsNullOrEmpty(inOutBlanaceRptQueryEntity.SkuID))
            {
                sqlWhere.Add(" IL.SKU_ID " + inOutBlanaceRptQueryEntity.SkuID);
            }
            if (!string.IsNullOrEmpty(inOutBlanaceRptQueryEntity.SkuClassID))
            {
                sqlWhere.Add(" SC.SKU_CLASS_ID " + inOutBlanaceRptQueryEntity.SkuClassID);
            }
            if (!string.IsNullOrEmpty(inOutBlanaceRptQueryEntity.VendorID))
            {
                sqlWhere.Add(" LA.VENDOR_ID " + inOutBlanaceRptQueryEntity.VendorID);
            }
            if (!string.IsNullOrEmpty(inOutBlanaceRptQueryEntity.LOT_ATTR01))
            {
                sqlWhere.Add(" LA.LOT_ATTR01 " + inOutBlanaceRptQueryEntity.LOT_ATTR01);
            }
            if (!string.IsNullOrEmpty(inOutBlanaceRptQueryEntity.LOT_ATTR02))
            {
                sqlWhere.Add(" LA.LOT_ATTR02 " + inOutBlanaceRptQueryEntity.LOT_ATTR02);
            }
            if (!string.IsNullOrEmpty(inOutBlanaceRptQueryEntity.LOT_ATTR03))
            {
                sqlWhere.Add(" LA.LOT_ATTR03 " + inOutBlanaceRptQueryEntity.LOT_ATTR03);
            }
            if (!string.IsNullOrEmpty(inOutBlanaceRptQueryEntity.LOT_ATTR04))
            {
                sqlWhere.Add(" LA.LOT_ATTR04 " + inOutBlanaceRptQueryEntity.LOT_ATTR04);
            }
            if (!string.IsNullOrEmpty(inOutBlanaceRptQueryEntity.LOT_ATTR05))
            {
                sqlWhere.Add(" LA.LOT_ATTR05 " + inOutBlanaceRptQueryEntity.LOT_ATTR05);
            }
            if (!string.IsNullOrEmpty(inOutBlanaceRptQueryEntity.LOT_ATTR06))
            {
                sqlWhere.Add(" LA.LOT_ATTR06 " + inOutBlanaceRptQueryEntity.LOT_ATTR06);
            }
            if (!string.IsNullOrEmpty(inOutBlanaceRptQueryEntity.LOT_ATTR07))
            {
                sqlWhere.Add(" LA.LOT_ATTR07 " + inOutBlanaceRptQueryEntity.LOT_ATTR07);
            }
            if (!string.IsNullOrEmpty(inOutBlanaceRptQueryEntity.LOT_ATTR08))
            {
                sqlWhere.Add(" LA.LOT_ATTR08 " + inOutBlanaceRptQueryEntity.LOT_ATTR08);
            }
            if (!string.IsNullOrEmpty(inOutBlanaceRptQueryEntity.LOT_ATTR09))
            {
                sqlWhere.Add(" LA.LOT_ATTR09 " + inOutBlanaceRptQueryEntity.LOT_ATTR09);
            }
            if (!string.IsNullOrEmpty(inOutBlanaceRptQueryEntity.LOT_ATTR10))
            {
                sqlWhere.Add(" LA.LOT_ATTR10 " + inOutBlanaceRptQueryEntity.LOT_ATTR10);
            }
            if (!string.IsNullOrEmpty(inOutBlanaceRptQueryEntity.EXTERNAL_LOT))
            {
                sqlWhere.Add(" LA.EXTERNAL_LOT " + inOutBlanaceRptQueryEntity.EXTERNAL_LOT);
            }
            return analyticsReportDA.GetInOutBlanaceRptDataSet(sqlWhere, inOutBlanaceRptQueryEntity, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetInOutInv2RptDetailDataSet(InOutStockRptDetailQueryEntity InOutStockRptDetailQuery)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.OWNER_ID))
            {
                sqlWhere.Add(" IT.OWNER_ID " + InOutStockRptDetailQuery.OWNER_ID);
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.SKU_ID))
            {
                sqlWhere.Add(" IT.SKU_ID " + InOutStockRptDetailQuery.SKU_ID);
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.SKU_DESCR))
            {
                sqlWhere.Add(" SKU.DESCR " + InOutStockRptDetailQuery.SKU_DESCR);
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.VENDOR_ID))
            {
                sqlWhere.Add(" LA.VENDOR_ID " + InOutStockRptDetailQuery.VENDOR_ID);
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.RECEIPT_ID))
            {
                sqlWhere.Add(" R.RECEIPT_ID " + InOutStockRptDetailQuery.RECEIPT_ID);
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.CONSIGNEE_ID))
            {
                sqlWhere.Add(" O.CONSIGNEE_ID " + InOutStockRptDetailQuery.CONSIGNEE_ID);
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.ITEM_NO_ID))
            {
                sqlWhere.Add(" LA.LOT_ATTR03 " + InOutStockRptDetailQuery.ITEM_NO_ID);
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.ORDER_ID))
            {
                sqlWhere.Add(" O.ORDER_ID " + InOutStockRptDetailQuery.ORDER_ID);
                InOutStockRptDetailQuery.STARTDATETIME = "";
                InOutStockRptDetailQuery.ENDDATETIME = "";
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.IMPORT_DECLARATIONS_ID))
            {
                sqlWhere.Add(" ID.DECLARATIONS_ID " + InOutStockRptDetailQuery.IMPORT_DECLARATIONS_ID);
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.EXPORT_DECLARATIONS_ID))
            {
                sqlWhere.Add(" ED.DECLARATIONS_ID " + InOutStockRptDetailQuery.EXPORT_DECLARATIONS_ID);
                InOutStockRptDetailQuery.STARTDATETIME = "";
                InOutStockRptDetailQuery.ENDDATETIME = "";
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.STARTDATETIME))
            {
                sqlWhere.Add(" R.RECEIPT_DATE >= '" + Convert.ToDateTime(InOutStockRptDetailQuery.STARTDATETIME).ToString("yyyy-MM-dd") + " 00:00:00'");
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.ENDDATETIME))
            {
                sqlWhere.Add(" R.RECEIPT_DATE <= '" + Convert.ToDateTime(InOutStockRptDetailQuery.ENDDATETIME).ToString("yyyy-MM-dd") + " 23:59:59'");
            }
            return analyticsReportDA.GetInOutInv2RptDetailDataSet(sqlWhere, InOutStockRptDetailQuery, this.pubParasInfo, this.dataBaseID[0]);
        }

        public DataSet GetInOutInvRptDetailDataSet(InOutStockRptDetailQueryEntity InOutStockRptDetailQuery)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.OWNER_ID))
            {
                sqlWhere.Add(" IT.OWNER_ID " + InOutStockRptDetailQuery.OWNER_ID);
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.SKU_ID))
            {
                sqlWhere.Add(" IT.SKU_ID " + InOutStockRptDetailQuery.SKU_ID);
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.SKU_DESCR))
            {
                sqlWhere.Add(" SKU.DESCR " + InOutStockRptDetailQuery.SKU_DESCR);
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.VENDOR_ID))
            {
                sqlWhere.Add(" LA.VENDOR_ID " + InOutStockRptDetailQuery.VENDOR_ID);
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.RECEIPT_ID))
            {
                sqlWhere.Add(" LA.LOT_ATTR10 " + InOutStockRptDetailQuery.RECEIPT_ID);
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.ORDER_ID))
            {
                sqlWhere.Add(" PD.ORDER_ID " + InOutStockRptDetailQuery.ORDER_ID);
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.CONSIGNEE_ID))
            {
                sqlWhere.Add(" ORDERS.CONSIGNEE_ID " + InOutStockRptDetailQuery.CONSIGNEE_ID);
            }
            if (string.IsNullOrEmpty(InOutStockRptDetailQuery.STARTDATETIME))
            {
                InOutStockRptDetailQuery.STARTDATETIME = "1900-01-01";
            }
            if (string.IsNullOrEmpty(InOutStockRptDetailQuery.ENDDATETIME))
            {
                InOutStockRptDetailQuery.ENDDATETIME = "9999-01-01";
            }
            return analyticsReportDA.GetInOutInvRptDetailDataSet(sqlWhere, InOutStockRptDetailQuery, this.pubParasInfo, this.dataBaseID[0]);
        }

        public DataSet GetInOutStockRptDetailInfo(InOutStockRptDetailQueryEntity InOutStockRptDetailQuery)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.OWNER_ID))
            {
                sqlWhere.Add(" TEMP.OWNER_ID " + InOutStockRptDetailQuery.OWNER_ID);
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.SKU_ID))
            {
                sqlWhere.Add(" TEMP.SKU_ID " + InOutStockRptDetailQuery.SKU_ID);
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.SKUCLASS_ID))
            {
                sqlWhere.Add(" TEMP.SKU_CLASS_ID " + InOutStockRptDetailQuery.SKUCLASS_ID);
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.STARTDATETIME))
            {
                sqlWhere.Add(" TEMP.TransactionDate >= '" + InOutStockRptDetailQuery.STARTDATETIME + "'");
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.ENDDATETIME))
            {
                sqlWhere.Add(" TEMP.TransactionDate <= '" + InOutStockRptDetailQuery.ENDDATETIME + "'");
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.LOT_ATTR01))
            {
                sqlWhere.Add(" TEMP.LOT_ATTR01 " + InOutStockRptDetailQuery.LOT_ATTR01);
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.LOT_ATTR02))
            {
                sqlWhere.Add(" TEMP.LOT_ATTR02" + InOutStockRptDetailQuery.LOT_ATTR02);
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.LOT_ATTR03))
            {
                sqlWhere.Add(" TEMP.LOT_ATTR03" + InOutStockRptDetailQuery.LOT_ATTR03);
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.LOT_ATTR04))
            {
                sqlWhere.Add(" TEMP.LOT_ATTR04" + InOutStockRptDetailQuery.LOT_ATTR04);
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.LOT_ATTR05))
            {
                sqlWhere.Add(" TEMP.LOT_ATTR05" + InOutStockRptDetailQuery.LOT_ATTR05);
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.LOT_ATTR06))
            {
                sqlWhere.Add(" TEMP.LOT_ATTR06" + InOutStockRptDetailQuery.LOT_ATTR06);
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.LOT_ATTR07))
            {
                sqlWhere.Add(" TEMP.LOT_ATTR07" + InOutStockRptDetailQuery.LOT_ATTR07);
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.LOT_ATTR08))
            {
                sqlWhere.Add(" TEMP.LOT_ATTR08" + InOutStockRptDetailQuery.LOT_ATTR08);
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.LOT_ATTR09))
            {
                sqlWhere.Add(" TEMP.LOT_ATTR09" + InOutStockRptDetailQuery.LOT_ATTR09);
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.LOT_ATTR10))
            {
                sqlWhere.Add(" TEMP.LOT_ATTR10" + InOutStockRptDetailQuery.LOT_ATTR10);
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.PRODUCE_DATE))
            {
                sqlWhere.Add(InOutStockRptDetailQuery.PRODUCE_DATE.Replace("@ProduceDate@", " TEMP.PRODUCE_DATE "));
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.EXPIRY_DATE))
            {
                sqlWhere.Add(InOutStockRptDetailQuery.EXPIRY_DATE.Replace("@ExpiryDate@", " TEMP.EXPIRY_DATE "));
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.RECEIPT_ID))
            {
                sqlWhere.Add(" TEMP.RECEIPT_ID" + InOutStockRptDetailQuery.RECEIPT_ID);
            }
            if (!string.IsNullOrEmpty(InOutStockRptDetailQuery.VENDOR_ID))
            {
                sqlWhere.Add(" TEMP.VENDOR_ID" + InOutStockRptDetailQuery.VENDOR_ID);
            }
            return analyticsReportDA.GetInOutStockRptDetailInfo(sqlWhere, InOutStockRptDetailQuery, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetInOutStockRptInfo(InOutStockRptQueryEntity InOutStockRptQuery)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(InOutStockRptQuery.OWNER_ID))
            {
                sqlWhere.Add(" s.OWNER_ID " + InOutStockRptQuery.OWNER_ID);
            }
            if (!string.IsNullOrEmpty(InOutStockRptQuery.SKU_ID))
            {
                sqlWhere.Add(" s.SKU_ID " + InOutStockRptQuery.SKU_ID);
            }
            if (!string.IsNullOrEmpty(InOutStockRptQuery.SKUCLASS_ID))
            {
                sqlWhere.Add(" s.SKU_CLASS_ID " + InOutStockRptQuery.SKUCLASS_ID);
            }
            if (!string.IsNullOrEmpty(InOutStockRptQuery.DESCR))
            {
                sqlWhere.Add(" s.DESCR " + InOutStockRptQuery.DESCR);
            }
            if (!string.IsNullOrEmpty(InOutStockRptQuery.VENDOR_ID))
            {
                sqlWhere.Add(" la.VENDOR_ID " + InOutStockRptQuery.VENDOR_ID);
            }
            if (!string.IsNullOrEmpty(InOutStockRptQuery.LOT_ATTR01))
            {
                sqlWhere.Add(" la.LOT_ATTR01 " + InOutStockRptQuery.LOT_ATTR01);
            }
            if (!string.IsNullOrEmpty(InOutStockRptQuery.LOT_ATTR02))
            {
                sqlWhere.Add(" la.LOT_ATTR02" + InOutStockRptQuery.LOT_ATTR02);
            }
            if (!string.IsNullOrEmpty(InOutStockRptQuery.LOT_ATTR03))
            {
                sqlWhere.Add(" la.LOT_ATTR03" + InOutStockRptQuery.LOT_ATTR03);
            }
            if (!string.IsNullOrEmpty(InOutStockRptQuery.LOT_ATTR04))
            {
                sqlWhere.Add(" la.LOT_ATTR04" + InOutStockRptQuery.LOT_ATTR04);
            }
            if (!string.IsNullOrEmpty(InOutStockRptQuery.LOT_ATTR05))
            {
                sqlWhere.Add(" la.LOT_ATTR05" + InOutStockRptQuery.LOT_ATTR05);
            }
            if (!string.IsNullOrEmpty(InOutStockRptQuery.LOT_ATTR06))
            {
                sqlWhere.Add(" la.LOT_ATTR06" + InOutStockRptQuery.LOT_ATTR06);
            }
            if (!string.IsNullOrEmpty(InOutStockRptQuery.LOT_ATTR07))
            {
                sqlWhere.Add(" la.LOT_ATTR07" + InOutStockRptQuery.LOT_ATTR07);
            }
            if (!string.IsNullOrEmpty(InOutStockRptQuery.LOT_ATTR08))
            {
                sqlWhere.Add(" la.LOT_ATTR08" + InOutStockRptQuery.LOT_ATTR08);
            }
            if (!string.IsNullOrEmpty(InOutStockRptQuery.LOT_ATTR09))
            {
                sqlWhere.Add(" la.LOT_ATTR09" + InOutStockRptQuery.LOT_ATTR09);
            }
            if (!string.IsNullOrEmpty(InOutStockRptQuery.LOT_ATTR10))
            {
                sqlWhere.Add(" la.LOT_ATTR10" + InOutStockRptQuery.LOT_ATTR10);
            }
            if (!string.IsNullOrEmpty(InOutStockRptQuery.PRODUCE_DATE))
            {
                sqlWhere.Add(InOutStockRptQuery.PRODUCE_DATE.Replace("@ProduceDate@", " la.PRODUCE_DATE "));
            }
            if (!string.IsNullOrEmpty(InOutStockRptQuery.EXPIRY_DATE))
            {
                sqlWhere.Add(InOutStockRptQuery.EXPIRY_DATE.Replace("@ExpiryDate@", " la.EXPIRY_DATE "));
            }
            return analyticsReportDA.GetInOutStockRptInfo(sqlWhere, InOutStockRptQuery, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetInvLocSkyTransRptDataSet(InvLocSkyTransRptQueryEntity invLocSkyTransRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (invLocSkyTransRptQueryEntity.INSERT_DAILY_DATA)
            {
                int i;
                DailyInvLocSkytransInfo dailyInvLocSkytransInfo = new DailyInvLocSkytransInfo();
                invLocSkyTransRptQueryEntity.OWNER_ID = invLocSkyTransRptQueryEntity.OWNER_ID.Trim();
                invLocSkyTransRptQueryEntity.VENDOR_ID = invLocSkyTransRptQueryEntity.VENDOR_ID.Trim();
                if (invLocSkyTransRptQueryEntity.OWNER_ID.StartsWith("IN (") || invLocSkyTransRptQueryEntity.OWNER_ID.EndsWith(")"))
                {
                    string[] ownerIDs = invLocSkyTransRptQueryEntity.OWNER_ID.Replace("IN (", "").Replace("'", "").Replace(")", "").Trim().Split(new char[] { ',' });
                    for (i = 0; i < ownerIDs.Length; i++)
                    {
                        dailyInvLocSkytransInfo.OwnerID = ownerIDs[i];
                        dailyInvLocSkytransInfo.InvDate = invLocSkyTransRptQueryEntity.INV_DATETIME;
                        dailyInvLocSkytransInfo.CreatedBy = this.pubParasInfo.UserID;
                        dailyInvLocSkytransInfo.UpdatedBy = this.pubParasInfo.UserID;
                        dailyInvLocSkytransDA.InsertDailyInvLocSkytransByOwner(dailyInvLocSkytransInfo, this.dataBaseID);
                    }
                }
                else
                {
                    if (invLocSkyTransRptQueryEntity.OWNER_ID.StartsWith("=") || invLocSkyTransRptQueryEntity.OWNER_ID.EndsWith("'"))
                    {
                        dailyInvLocSkytransInfo.OwnerID = invLocSkyTransRptQueryEntity.OWNER_ID.Substring(2, invLocSkyTransRptQueryEntity.OWNER_ID.Length - 3);
                    }
                    else
                    {
                        dailyInvLocSkytransInfo.OwnerID = invLocSkyTransRptQueryEntity.OWNER_ID;
                    }
                    dailyInvLocSkytransInfo.InvDate = invLocSkyTransRptQueryEntity.INV_DATETIME;
                    dailyInvLocSkytransInfo.CreatedBy = this.pubParasInfo.UserID;
                    dailyInvLocSkytransInfo.UpdatedBy = this.pubParasInfo.UserID;
                    dailyInvLocSkytransDA.InsertDailyInvLocSkytransByOwner(dailyInvLocSkytransInfo, this.dataBaseID);
                }
                if (invLocSkyTransRptQueryEntity.VENDOR_ID.StartsWith("IN (") || invLocSkyTransRptQueryEntity.VENDOR_ID.EndsWith(")"))
                {
                    string[] vendorIDs = invLocSkyTransRptQueryEntity.VENDOR_ID.Replace("IN (", "").Replace("'", "").Replace(")", "").Trim().Split(new char[] { ',' });
                    for (i = 0; i < vendorIDs.Length; i++)
                    {
                        dailyInvLocSkytransInfo.VendorID = vendorIDs[i];
                        dailyInvLocSkytransInfo.InvDate = invLocSkyTransRptQueryEntity.INV_DATETIME;
                        dailyInvLocSkytransInfo.CreatedBy = this.pubParasInfo.UserID;
                        dailyInvLocSkytransInfo.UpdatedBy = this.pubParasInfo.UserID;
                        dailyInvLocSkytransDA.InsertDailyInvLocSkytransByVendor(dailyInvLocSkytransInfo, this.dataBaseID);
                    }
                }
                else
                {
                    if (invLocSkyTransRptQueryEntity.VENDOR_ID.StartsWith("=") || invLocSkyTransRptQueryEntity.VENDOR_ID.EndsWith("'"))
                    {
                        dailyInvLocSkytransInfo.VendorID = invLocSkyTransRptQueryEntity.VENDOR_ID.Substring(2, invLocSkyTransRptQueryEntity.VENDOR_ID.Length - 3);
                    }
                    else
                    {
                        dailyInvLocSkytransInfo.VendorID = invLocSkyTransRptQueryEntity.VENDOR_ID;
                    }
                    dailyInvLocSkytransInfo.InvDate = invLocSkyTransRptQueryEntity.INV_DATETIME;
                    dailyInvLocSkytransInfo.CreatedBy = this.pubParasInfo.UserID;
                    dailyInvLocSkytransInfo.UpdatedBy = this.pubParasInfo.UserID;
                    dailyInvLocSkytransDA.InsertDailyInvLocSkytransByVendor(dailyInvLocSkytransInfo, this.dataBaseID);
                }
            }
            if (!string.IsNullOrEmpty(invLocSkyTransRptQueryEntity.OWNER_ID))
            {
                sqlWhere.Add(" OWNER_ID " + invLocSkyTransRptQueryEntity.OWNER_ID);
            }
            if (!string.IsNullOrEmpty(invLocSkyTransRptQueryEntity.VENDOR_ID))
            {
                sqlWhere.Add(" VENDOR_ID " + invLocSkyTransRptQueryEntity.VENDOR_ID);
            }
            return analyticsReportDA.GetInvLocSkyTransRptDataSet(sqlWhere, invLocSkyTransRptQueryEntity, this.pubParasInfo, this.dataBaseID[0]);
        }

        public DataSet GetInvoiceRpt2DataSet(InvoiceRptQueryEntity invoiceRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(invoiceRptQueryEntity.DUE_FROM_TO))
            {
                sqlWhere.Add(" I.DUE_FROM_TO " + invoiceRptQueryEntity.DUE_FROM_TO);
            }
            if (!string.IsNullOrEmpty(invoiceRptQueryEntity.BILLING_OBJECT))
            {
                sqlWhere.Add(" I.BILLING_OBJECT " + invoiceRptQueryEntity.BILLING_OBJECT);
            }
            if (!string.IsNullOrEmpty(invoiceRptQueryEntity.BILLING_OBJECT_ID))
            {
                sqlWhere.Add(" I.BILLING_OBJECT_ID " + invoiceRptQueryEntity.BILLING_OBJECT_ID);
            }
            GlobalSettingInfo globalSettingInfo = globalSettingDA.GetGlobalSettingByID("BILLING_INVOICE_REPORT_STTTING");
            if (globalSettingInfo != null)
            {
                if (string.IsNullOrEmpty(globalSettingInfo.Value))
                {
                    globalSettingInfo.Value = "30,60";
                }
                invoiceRptQueryEntity.BILLING_INVOICE_SETTING = globalSettingInfo.Value;
            }
            else
            {
                invoiceRptQueryEntity.BILLING_INVOICE_SETTING = "30,60";
            }
            return analyticsReportDA.GetInvoiceRpt2DataSet(sqlWhere, invoiceRptQueryEntity, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetInvoiceRptDataSet(InvoiceRptQueryEntity invoiceRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(invoiceRptQueryEntity.INVOICE_ID))
            {
                sqlWhere.Add(" I.INVOICE_ID " + invoiceRptQueryEntity.INVOICE_ID);
            }
            if (!string.IsNullOrEmpty(invoiceRptQueryEntity.OWNER_ID))
            {
                sqlWhere.Add(" OWNER.OWNER_ID " + invoiceRptQueryEntity.OWNER_ID);
            }
            if (!string.IsNullOrEmpty(invoiceRptQueryEntity.INVOICE_STATUS))
            {
                sqlWhere.Add(" I.STATUS " + invoiceRptQueryEntity.INVOICE_STATUS);
            }
            if (!string.IsNullOrEmpty(invoiceRptQueryEntity.STATEMENT_ID))
            {
                sqlWhere.Add(" IND.STATEMENT_ID " + invoiceRptQueryEntity.STATEMENT_ID);
            }
            if (!string.IsNullOrEmpty(invoiceRptQueryEntity.INVOICE_SUBMIT))
            {
                sqlWhere.Add(" I.IS_INVOICE_SUBMIT " + invoiceRptQueryEntity.INVOICE_SUBMIT);
            }
            if (!string.IsNullOrEmpty(invoiceRptQueryEntity.PAY_SUBMIT))
            {
                sqlWhere.Add(" I.IS_AMOUNT_SUBMIT " + invoiceRptQueryEntity.PAY_SUBMIT);
            }
            if (!string.IsNullOrEmpty(invoiceRptQueryEntity.StartDateTime))
            {
                sqlWhere.Add(" I.CREATED_DATE >= '" + Convert.ToDateTime(invoiceRptQueryEntity.StartDateTime).ToString("yyyy-MM-dd") + " 00:00:00'");
            }
            if (!string.IsNullOrEmpty(invoiceRptQueryEntity.EndDateTime))
            {
                sqlWhere.Add(" I.CREATED_DATE <= '" + Convert.ToDateTime(invoiceRptQueryEntity.EndDateTime).ToString("yyyy-MM-dd") + " 23:59:59'");
            }
            return analyticsReportDA.GetInvoiceRptDataSet(sqlWhere, invoiceRptQueryEntity, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetLoadingRptDataSet(LoadingRptQueryEntity loadingRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(loadingRptQueryEntity.BolID))
            {
                sqlWhere.Add(" BOL.BOL_ID " + loadingRptQueryEntity.BolID);
            }
            if (!string.IsNullOrEmpty(loadingRptQueryEntity.ExternOrderId2))
            {
                sqlWhere.Add(" DO.EXTERN_ORDER_ID2 " + loadingRptQueryEntity.ExternOrderId2);
            }
            if (!string.IsNullOrEmpty(loadingRptQueryEntity.OwnerID))
            {
                sqlWhere.Add(" BD.OWNER_ID " + loadingRptQueryEntity.OwnerID);
            }
            if (!string.IsNullOrEmpty(loadingRptQueryEntity.CarrierID))
            {
                sqlWhere.Add(" BD.CARRIER " + loadingRptQueryEntity.CarrierID);
            }
            if (!string.IsNullOrEmpty(loadingRptQueryEntity.Status))
            {
                sqlWhere.Add(" BD.STATUS " + loadingRptQueryEntity.Status);
            }
            if (!string.IsNullOrEmpty(loadingRptQueryEntity.Paid))
            {
                sqlWhere.Add(" BOL.PAID " + loadingRptQueryEntity.Paid);
            }
            if (!string.IsNullOrEmpty(loadingRptQueryEntity.BeginDate))
            {
                sqlWhere.Add(" BOL.CREATED_DATE >= '" + Convert.ToDateTime(loadingRptQueryEntity.BeginDate).ToString("yyyy-MM-dd") + " 00:00:00'");
            }
            if (!string.IsNullOrEmpty(loadingRptQueryEntity.EndDate))
            {
                sqlWhere.Add(" BOL.CREATED_DATE <= '" + Convert.ToDateTime(loadingRptQueryEntity.EndDate).ToString("yyyy-MM-dd") + " 23:59:59'");
            }
            return analyticsReportDA.GetLoadingRptDataSet(sqlWhere, loadingRptQueryEntity, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetLocationRptInfo(LocationRptQueryEntity locationRptQuery)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(locationRptQuery.LOC))
            {
                sqlWhere.Add(" LOC.LOC " + locationRptQuery.LOC);
            }
            if (!string.IsNullOrEmpty(locationRptQuery.ZONE_ID))
            {
                sqlWhere.Add(" LOC.ZONE_ID " + locationRptQuery.ZONE_ID);
            }
            if (!string.IsNullOrEmpty(locationRptQuery.LOC_USAGE))
            {
                sqlWhere.Add(" LOC.LOC_USAGE " + locationRptQuery.LOC_USAGE);
            }
            if (!string.IsNullOrEmpty(locationRptQuery.ABC))
            {
                sqlWhere.Add(" LOC.ABC " + locationRptQuery.ABC);
            }
            if (!string.IsNullOrEmpty(locationRptQuery.STATUS))
            {
                sqlWhere.Add(" LOC.STATUS " + locationRptQuery.STATUS);
            }
            if (!string.IsNullOrEmpty(locationRptQuery.LOC_FLAG))
            {
                sqlWhere.Add(" LOC.LOC_FLAG " + locationRptQuery.LOC_FLAG);
            }
            return analyticsReportDA.GetLocationRptInfo(sqlWhere, locationRptQuery, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetOnTheWayOrderRptDataSet(OnTheWayOrderRptQueryEntity onTheWayOrderRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(onTheWayOrderRptQueryEntity.PO_ID))
            {
                sqlWhere.Add(" A.PO_ID " + onTheWayOrderRptQueryEntity.PO_ID);
            }
            if (!string.IsNullOrEmpty(onTheWayOrderRptQueryEntity.EXTERNAL_PO_ID))
            {
                sqlWhere.Add(" A.EXTERNAL_PO_ID " + onTheWayOrderRptQueryEntity.EXTERNAL_PO_ID);
            }
            if (!string.IsNullOrEmpty(onTheWayOrderRptQueryEntity.SKU_ID))
            {
                sqlWhere.Add(" B.SKU_ID " + onTheWayOrderRptQueryEntity.SKU_ID);
            }
            if (!string.IsNullOrEmpty(onTheWayOrderRptQueryEntity.SKU_CLASS_ID))
            {
                sqlWhere.Add("C.SKU_CLASS_ID " + onTheWayOrderRptQueryEntity.SKU_CLASS_ID);
            }
            if (!string.IsNullOrEmpty(onTheWayOrderRptQueryEntity.OWNER_ID))
            {
                sqlWhere.Add("A.OWNER_ID " + onTheWayOrderRptQueryEntity.OWNER_ID);
            }
            if (!string.IsNullOrEmpty(onTheWayOrderRptQueryEntity.VENDOR_ID))
            {
                sqlWhere.Add("A.VENDOR_ID " + onTheWayOrderRptQueryEntity.VENDOR_ID);
            }
            if (!string.IsNullOrEmpty(onTheWayOrderRptQueryEntity.PO_DATE))
            {
                sqlWhere.Add("A.PO_DATE " + onTheWayOrderRptQueryEntity.PO_DATE);
            }
            sqlWhere.Add(" (B.STATUS ='NEW' OR B.STATUS = 'InReceiving') ");
            return analyticsReportDA.GetOnTheWayOrderRptDataSet(sqlWhere, onTheWayOrderRptQueryEntity, this.pubParasInfo, this.dataBaseID[0]);
        }

        public DataSet GetOperationLogDataSet(OperationLogQueryEntity operationLogQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(operationLogQueryEntity.UserID))
            {
                sqlWhere.Add(" A.USER_ID " + operationLogQueryEntity.UserID);
            }
            if (!string.IsNullOrEmpty(operationLogQueryEntity.StartDatetime))
            {
                sqlWhere.Add(operationLogQueryEntity.StartDatetime.Replace("@StartDateTime@", " A.LOG_DATE "));
            }
            if (!string.IsNullOrEmpty(operationLogQueryEntity.EndDatetime))
            {
                sqlWhere.Add(operationLogQueryEntity.EndDatetime.Replace("@EndDateTime@", " A.LOG_DATE "));
            }
            if (!string.IsNullOrEmpty(operationLogQueryEntity.Descr))
            {
                sqlWhere.Add(" A.OPERATION_DESCR " + operationLogQueryEntity.Descr);
            }
            return analyticsReportDA.GetOperationLogDataSet(sqlWhere, operationLogQueryEntity, operationLogQueryEntity.WhID, this.pubParasInfo);
        }

        public DataSet GetOperatorWorkRptDataSet(OperatorWorkRptQueryEntity operatorWorkRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(operatorWorkRptQueryEntity.Operator_ID))
            {
                sqlWhere.Add(" U.[USER_ID] " + operatorWorkRptQueryEntity.Operator_ID);
            }
            if (!string.IsNullOrEmpty(operatorWorkRptQueryEntity.StartDateTime))
            {
                sqlWhere.Add(" C.CREATED_DATE >= '" + Convert.ToDateTime(operatorWorkRptQueryEntity.StartDateTime).ToString("yyyy-MM-dd") + " 00:00:00'");
            }
            if (!string.IsNullOrEmpty(operatorWorkRptQueryEntity.EndDateTime))
            {
                sqlWhere.Add(" C.CREATED_DATE <= '" + Convert.ToDateTime(operatorWorkRptQueryEntity.EndDateTime).ToString("yyyy-MM-dd") + " 23:59:59'");
            }
            return analyticsReportDA.GetOperatorWorkRptDataSet(sqlWhere, operatorWorkRptQueryEntity, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetOwnerTransferRptDataSet(OwnerTransferRptQueryEntity ownerTransferRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(ownerTransferRptQueryEntity.TransferID))
            {
                sqlWhere.Add(" A.TRANSFER_ID  " + ownerTransferRptQueryEntity.TransferID);
            }
            if (!string.IsNullOrEmpty(ownerTransferRptQueryEntity.FromOwnerID))
            {
                sqlWhere.Add(" A.FROM_OWNER_ID  " + ownerTransferRptQueryEntity.FromOwnerID);
            }
            if (!string.IsNullOrEmpty(ownerTransferRptQueryEntity.ToOwnerID))
            {
                sqlWhere.Add(" A.TO_OWNER_ID  " + ownerTransferRptQueryEntity.ToOwnerID);
            }
            if (!string.IsNullOrEmpty(ownerTransferRptQueryEntity.FromSkuID))
            {
                sqlWhere.Add(" A.FROM_SKU_ID  " + ownerTransferRptQueryEntity.FromSkuID);
            }
            if (!string.IsNullOrEmpty(ownerTransferRptQueryEntity.FromDescr))
            {
                sqlWhere.Add(" FC.DESCR " + ownerTransferRptQueryEntity.FromDescr);
            }
            if (!string.IsNullOrEmpty(ownerTransferRptQueryEntity.ToSkuID))
            {
                sqlWhere.Add(" A.TO_SKU_ID  " + ownerTransferRptQueryEntity.ToSkuID);
            }
            if (!string.IsNullOrEmpty(ownerTransferRptQueryEntity.ToDescr))
            {
                sqlWhere.Add(" TC.DESCR  " + ownerTransferRptQueryEntity.ToDescr);
            }
            if (!string.IsNullOrEmpty(ownerTransferRptQueryEntity.TransferDate))
            {
                sqlWhere.Add(" A.TRANSFER_DATE " + ownerTransferRptQueryEntity.TransferDate);
            }
            return analyticsReportDA.GetOwnerTransferRptDataSet(sqlWhere, ownerTransferRptQueryEntity, this.pubParasInfo, this.dataBaseID[0]);
        }

        public DataSet GetPhysicalCountReportDataSet(PhysicalCountDiffRptQueryEntity physicalCountDiffRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(physicalCountDiffRptQueryEntity.OwnerID))
            {
                sqlWhere.Add("PT.OWNER_ID " + physicalCountDiffRptQueryEntity.OwnerID);
            }
            if (!string.IsNullOrEmpty(physicalCountDiffRptQueryEntity.SkuID))
            {
                sqlWhere.Add("PT.SKU_ID " + physicalCountDiffRptQueryEntity.SkuID);
            }
            if (!string.IsNullOrEmpty(physicalCountDiffRptQueryEntity.SkuClassID))
            {
                sqlWhere.Add("S.SKU_CLASS_ID " + physicalCountDiffRptQueryEntity.SkuClassID);
            }
            if (!string.IsNullOrEmpty(physicalCountDiffRptQueryEntity.StartLoc))
            {
                sqlWhere.Add("PT.Loc " + physicalCountDiffRptQueryEntity.StartLoc);
            }
            if (!string.IsNullOrEmpty(physicalCountDiffRptQueryEntity.EndLoc))
            {
                sqlWhere.Add("PT.Loc " + physicalCountDiffRptQueryEntity.EndLoc);
            }
            return analyticsReportDA.GetPhysicalCountReportDataSet(sqlWhere, physicalCountDiffRptQueryEntity, this.pubParasInfo, this.dataBaseID[0]);
        }

        public DataSet GetPhysicalCountReportList(PhysicalCountRptQueryEntity physicalCountRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(physicalCountRptQueryEntity.OwnerID))
            {
                sqlWhere.Add(" A.OWNER_ID " + physicalCountRptQueryEntity.OwnerID);
            }
            if (!string.IsNullOrEmpty(physicalCountRptQueryEntity.SkuID))
            {
                sqlWhere.Add("  A.SKU_ID " + physicalCountRptQueryEntity.SkuID);
            }
            if (!string.IsNullOrEmpty(physicalCountRptQueryEntity.SkuClassID))
            {
                sqlWhere.Add(" B.SKU_CLASS_ID " + physicalCountRptQueryEntity.SkuClassID);
            }
            if (!string.IsNullOrEmpty(physicalCountRptQueryEntity.SkuDescr))
            {
                sqlWhere.Add(" B.DESCR " + physicalCountRptQueryEntity.SkuDescr);
            }
            if (!string.IsNullOrEmpty(physicalCountRptQueryEntity.ExternalLot))
            {
                sqlWhere.Add(" D.EXTERNAL_LOT " + physicalCountRptQueryEntity.ExternalLot);
            }
            if (!string.IsNullOrEmpty(physicalCountRptQueryEntity.VendorID))
            {
                sqlWhere.Add(" D.VENDOR_ID " + physicalCountRptQueryEntity.VendorID);
            }
            if (!string.IsNullOrEmpty(physicalCountRptQueryEntity.Lot))
            {
                sqlWhere.Add(" D.LOT " + physicalCountRptQueryEntity.Lot);
            }
            if (!string.IsNullOrEmpty(physicalCountRptQueryEntity.LPN))
            {
                sqlWhere.Add(" A.LPN_ID " + physicalCountRptQueryEntity.LPN);
            }
            if (!string.IsNullOrEmpty(physicalCountRptQueryEntity.StartLoc))
            {
                sqlWhere.Add(" L.Loc " + physicalCountRptQueryEntity.StartLoc);
            }
            if (!string.IsNullOrEmpty(physicalCountRptQueryEntity.ZoneID))
            {
                sqlWhere.Add(" L.ZONE_ID " + physicalCountRptQueryEntity.ZoneID);
            }
            if (physicalCountRptQueryEntity.ShowLoc == "N")
            {
                sqlWhere.Add(" A.SKU_ID IS NOT NULL AND  A.QTY>0 ");
            }
            else
            {
                sqlWhere.Add("  ( A.QTY>0  OR A.QTY IS NULL )");
            }
            return analyticsReportDA.GetPhysicalCountReportList(sqlWhere, physicalCountRptQueryEntity, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetPickingRptInfo(PickingRptQueryEntity PickingRptQuery)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(PickingRptQuery.ORDER_ID))
            {
                sqlWhere.Add(" ORDERS.ORDER_ID " + PickingRptQuery.ORDER_ID);
            }
            if (!string.IsNullOrEmpty(PickingRptQuery.EXTERN_ORDER_ID))
            {
                sqlWhere.Add(" ORDERS.EXTERN_ORDER_ID " + PickingRptQuery.EXTERN_ORDER_ID);
            }
            if (!string.IsNullOrEmpty(PickingRptQuery.REFERENCE_NUM))
            {
                sqlWhere.Add(" ORDERS.REFERENCE_NUM " + PickingRptQuery.REFERENCE_NUM);
            }
            if (!string.IsNullOrEmpty(PickingRptQuery.WaveID))
            {
                sqlWhere.Add(" WD.WAVE_ID " + PickingRptQuery.WaveID);
            }
            if (!string.IsNullOrEmpty(PickingRptQuery.OWNER_ID))
            {
                sqlWhere.Add(" PD.OWNER_ID " + PickingRptQuery.OWNER_ID);
            }
            if (!string.IsNullOrEmpty(PickingRptQuery.SKU_CLASS_ID))
            {
                sqlWhere.Add(" SKU.SKU_CLASS_ID " + PickingRptQuery.SKU_CLASS_ID);
            }
            if (!string.IsNullOrEmpty(PickingRptQuery.SKU_ID))
            {
                sqlWhere.Add(" PD.SKU_ID " + PickingRptQuery.SKU_ID);
            }
            if (!string.IsNullOrEmpty(PickingRptQuery.SKU_DESCR))
            {
                sqlWhere.Add(" SKU.DESCR " + PickingRptQuery.SKU_DESCR);
            }
            if (!string.IsNullOrEmpty(PickingRptQuery.CUSTOMER_ID))
            {
                sqlWhere.Add(" ORDERS.CONSIGNEE_ID " + PickingRptQuery.CUSTOMER_ID);
            }
            if (!string.IsNullOrEmpty(PickingRptQuery.StartDateTime))
            {
                sqlWhere.Add(" TD.RELEASE_DATE   >= '" + PickingRptQuery.StartDateTime + "'");
            }
            if (!string.IsNullOrEmpty(PickingRptQuery.EndDateTime))
            {
                sqlWhere.Add(" TD.RELEASE_DATE <= '" + PickingRptQuery.EndDateTime + "'");
            }
            if (!string.IsNullOrEmpty(PickingRptQuery.LOT_ATTR01))
            {
                sqlWhere.Add(" LA.LOT_ATTR01 " + PickingRptQuery.LOT_ATTR01);
            }
            if (!string.IsNullOrEmpty(PickingRptQuery.LOT_ATTR02))
            {
                sqlWhere.Add(" LA.LOT_ATTR02" + PickingRptQuery.LOT_ATTR02);
            }
            if (!string.IsNullOrEmpty(PickingRptQuery.LOT_ATTR03))
            {
                sqlWhere.Add(" LA.LOT_ATTR03" + PickingRptQuery.LOT_ATTR03);
            }
            if (!string.IsNullOrEmpty(PickingRptQuery.LOT_ATTR04))
            {
                sqlWhere.Add(" LA.LOT_ATTR04" + PickingRptQuery.LOT_ATTR04);
            }
            if (!string.IsNullOrEmpty(PickingRptQuery.LOT_ATTR05))
            {
                sqlWhere.Add(" LA.LOT_ATTR05" + PickingRptQuery.LOT_ATTR05);
            }
            if (!string.IsNullOrEmpty(PickingRptQuery.LOT_ATTR06))
            {
                sqlWhere.Add(" LA.LOT_ATTR06" + PickingRptQuery.LOT_ATTR06);
            }
            if (!string.IsNullOrEmpty(PickingRptQuery.LOT_ATTR07))
            {
                sqlWhere.Add(" LA.LOT_ATTR07" + PickingRptQuery.LOT_ATTR07);
            }
            if (!string.IsNullOrEmpty(PickingRptQuery.LOT_ATTR08))
            {
                sqlWhere.Add(" LA.LOT_ATTR08" + PickingRptQuery.LOT_ATTR08);
            }
            if (!string.IsNullOrEmpty(PickingRptQuery.LOT_ATTR09))
            {
                sqlWhere.Add(" LA.LOT_ATTR09" + PickingRptQuery.LOT_ATTR09);
            }
            if (!string.IsNullOrEmpty(PickingRptQuery.LOT_ATTR10))
            {
                sqlWhere.Add(" LA.LOT_ATTR10" + PickingRptQuery.LOT_ATTR10);
            }
            if (!string.IsNullOrEmpty(PickingRptQuery.VENDOR_ID))
            {
                sqlWhere.Add(" LA.VENDOR_ID" + PickingRptQuery.VENDOR_ID);
            }
            if (!string.IsNullOrEmpty(PickingRptQuery.PRODUCE_DATE))
            {
                sqlWhere.Add(PickingRptQuery.PRODUCE_DATE.Replace("@ProduceDate@", " LA.PRODUCE_DATE "));
            }
            if (!string.IsNullOrEmpty(PickingRptQuery.EXPIRY_DATE))
            {
                sqlWhere.Add(PickingRptQuery.EXPIRY_DATE.Replace("@ExpiryDate@", " LA.EXPIRY_DATE "));
            }
            if (!string.IsNullOrEmpty(PickingRptQuery.EXTERNAL_LOT))
            {
                sqlWhere.Add(" LA.EXTERNAL_LOT" + PickingRptQuery.EXTERNAL_LOT);
            }
            if (!string.IsNullOrEmpty(PickingRptQuery.LPN_ID))
            {
                sqlWhere.Add(" PD.LPN_ID" + PickingRptQuery.LPN_ID);
            }
            if (!string.IsNullOrEmpty(PickingRptQuery.VENDOR_ID))
            {
                sqlWhere.Add(" LA.VENDOR_ID " + PickingRptQuery.VENDOR_ID);
            }
            if (!string.IsNullOrEmpty(PickingRptQuery.Status))
            {
                sqlWhere.Add(" PD.STATUS " + PickingRptQuery.Status);
            }
            return analyticsReportDA.GetPickPickingRptInfo(sqlWhere, PickingRptQuery, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetPurchasePlanRptDataSet(PurchasePlanRptQueryEntity purchasePlanRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(purchasePlanRptQueryEntity.OWNER_ID))
            {
                sqlWhere.Add(" INV.OWNER_ID " + purchasePlanRptQueryEntity.OWNER_ID);
            }
            if (!string.IsNullOrEmpty(purchasePlanRptQueryEntity.SKU_CLASS_ID))
            {
                sqlWhere.Add(" INV.SKU_CLASS_ID " + purchasePlanRptQueryEntity.SKU_CLASS_ID);
            }
            if (!string.IsNullOrEmpty(purchasePlanRptQueryEntity.SKU_ID))
            {
                sqlWhere.Add(" INV.SKU_ID " + purchasePlanRptQueryEntity.SKU_ID);
            }
            return analyticsReportDA.GetPurchasePlanRptDataSet(sqlWhere, purchasePlanRptQueryEntity, this.pubParasInfo, this.dataBaseID[0]);
        }

        public DataSet GetReceiptDetailRptInfo(ReceiptDetailRptQueryEntity receiptDetailRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(receiptDetailRptQueryEntity.RECEIPT_ID))
            {
                sqlWhere.Add(" RD.RECEIPT_ID " + receiptDetailRptQueryEntity.RECEIPT_ID);
            }
            if (!string.IsNullOrEmpty(receiptDetailRptQueryEntity.PO_ID))
            {
                sqlWhere.Add(" RD.PO_ID " + receiptDetailRptQueryEntity.PO_ID);
            }
            if (!string.IsNullOrEmpty(receiptDetailRptQueryEntity.OWNER_ID))
            {
                sqlWhere.Add(" RD.OWNER_ID " + receiptDetailRptQueryEntity.OWNER_ID);
            }
            if (!string.IsNullOrEmpty(receiptDetailRptQueryEntity.EXTERN_RECEIPT_ID))
            {
                sqlWhere.Add(" R.EXTERNAL_RECEIPT_ID " + receiptDetailRptQueryEntity.EXTERN_RECEIPT_ID);
            }
            if (!string.IsNullOrEmpty(receiptDetailRptQueryEntity.RECEIPT_TYPE))
            {
                sqlWhere.Add(" R.RECEIPT_TYPE " + receiptDetailRptQueryEntity.RECEIPT_TYPE);
            }
            if (!string.IsNullOrEmpty(receiptDetailRptQueryEntity.STARTRECEIVED_DATE.ToString()))
            {
                sqlWhere.Add(" IT.TRANS_DATE >= '" + receiptDetailRptQueryEntity.STARTRECEIVED_DATE + "'");
            }
            if (!string.IsNullOrEmpty(receiptDetailRptQueryEntity.ENDRECEIVED_DATE.ToString()))
            {
                sqlWhere.Add(" IT.TRANS_DATE <= '" + receiptDetailRptQueryEntity.ENDRECEIVED_DATE + "'");
            }
            if (!string.IsNullOrEmpty(receiptDetailRptQueryEntity.SKU_CLASS_ID))
            {
                sqlWhere.Add(" SKU.SKU_CLASS_ID " + receiptDetailRptQueryEntity.SKU_CLASS_ID);
            }
            if (!string.IsNullOrEmpty(receiptDetailRptQueryEntity.SKU_ID))
            {
                sqlWhere.Add(" RD.SKU_ID " + receiptDetailRptQueryEntity.SKU_ID);
            }
            if (!string.IsNullOrEmpty(receiptDetailRptQueryEntity.DESCR))
            {
                sqlWhere.Add(" SKU.DESCR " + receiptDetailRptQueryEntity.DESCR);
            }
            if (!string.IsNullOrEmpty(receiptDetailRptQueryEntity.VENDOR_ID))
            {
                sqlWhere.Add(" IT.VENDOR_ID " + receiptDetailRptQueryEntity.VENDOR_ID);
            }
            if (!string.IsNullOrEmpty(receiptDetailRptQueryEntity.RMA))
            {
                sqlWhere.Add(" R.RMA " + receiptDetailRptQueryEntity.RMA);
            }
            if (!string.IsNullOrEmpty(receiptDetailRptQueryEntity.LOT_ATTR01))
            {
                sqlWhere.Add(" IT.LOT_ATTR01 " + receiptDetailRptQueryEntity.LOT_ATTR01);
            }
            if (!string.IsNullOrEmpty(receiptDetailRptQueryEntity.LOT_ATTR02))
            {
                sqlWhere.Add(" IT.LOT_ATTR02 " + receiptDetailRptQueryEntity.LOT_ATTR02);
            }
            if (!string.IsNullOrEmpty(receiptDetailRptQueryEntity.LOT_ATTR03))
            {
                sqlWhere.Add(" IT.LOT_ATTR03 " + receiptDetailRptQueryEntity.LOT_ATTR03);
            }
            if (!string.IsNullOrEmpty(receiptDetailRptQueryEntity.LOT_ATTR04))
            {
                sqlWhere.Add(" IT.LOT_ATTR04 " + receiptDetailRptQueryEntity.LOT_ATTR04);
            }
            if (!string.IsNullOrEmpty(receiptDetailRptQueryEntity.LOT_ATTR05))
            {
                sqlWhere.Add(" IT.LOT_ATTR05 " + receiptDetailRptQueryEntity.LOT_ATTR05);
            }
            if (!string.IsNullOrEmpty(receiptDetailRptQueryEntity.LOT_ATTR06))
            {
                sqlWhere.Add(" IT.LOT_ATTR06 " + receiptDetailRptQueryEntity.LOT_ATTR06);
            }
            if (!string.IsNullOrEmpty(receiptDetailRptQueryEntity.LOT_ATTR07))
            {
                sqlWhere.Add(" IT.LOT_ATTR07 " + receiptDetailRptQueryEntity.LOT_ATTR07);
            }
            if (!string.IsNullOrEmpty(receiptDetailRptQueryEntity.LOT_ATTR08))
            {
                sqlWhere.Add(" IT.LOT_ATTR08 " + receiptDetailRptQueryEntity.LOT_ATTR08);
            }
            if (!string.IsNullOrEmpty(receiptDetailRptQueryEntity.LOT_ATTR09))
            {
                sqlWhere.Add(" IT.LOT_ATTR09 " + receiptDetailRptQueryEntity.LOT_ATTR09);
            }
            if (!string.IsNullOrEmpty(receiptDetailRptQueryEntity.LOT_ATTR10))
            {
                sqlWhere.Add(" IT.LOT_ATTR10 " + receiptDetailRptQueryEntity.LOT_ATTR10);
            }
            if (!string.IsNullOrEmpty(receiptDetailRptQueryEntity.PRODUCE_DATE.ToString()))
            {
                sqlWhere.Add(receiptDetailRptQueryEntity.PRODUCE_DATE.Replace("@ProduceDate@", " IT.PRODUCE_DATE "));
            }
            if (!string.IsNullOrEmpty(receiptDetailRptQueryEntity.EXPIRY_DATE.ToString()))
            {
                sqlWhere.Add(receiptDetailRptQueryEntity.EXPIRY_DATE.Replace("@ExpiryDate@", " IT.EXPIRY_DATE "));
            }
            if (!string.IsNullOrEmpty(receiptDetailRptQueryEntity.EXTERNAL_LOT))
            {
                sqlWhere.Add(" IT.EXTERNAL_LOT " + receiptDetailRptQueryEntity.EXTERNAL_LOT);
            }
            return analyticsReportDA.GetReceiptDetailRptInfo(sqlWhere, receiptDetailRptQueryEntity, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetReceiptRptInfo(ReceiptRptQueryEntity ReceiptRptQuery)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(ReceiptRptQuery.RECEIPT_ID))
            {
                sqlWhere.Add(" RECEIPT_ID " + ReceiptRptQuery.RECEIPT_ID);
            }
            if (!string.IsNullOrEmpty(ReceiptRptQuery.EXTERNAL_RECEIPT_ID))
            {
                sqlWhere.Add(" EXTERNAL_RECEIPT_ID " + ReceiptRptQuery.EXTERNAL_RECEIPT_ID);
            }
            if (!string.IsNullOrEmpty(ReceiptRptQuery.PO_ID))
            {
                sqlWhere.Add(" PO_ID " + ReceiptRptQuery.PO_ID);
            }
            if (!string.IsNullOrEmpty(ReceiptRptQuery.OWNER_ID))
            {
                sqlWhere.Add(" OWNER_ID " + ReceiptRptQuery.OWNER_ID);
            }
            if (!string.IsNullOrEmpty(ReceiptRptQuery.RECEIPT_TYPE))
            {
                sqlWhere.Add(" RECEIPT_TYPE " + ReceiptRptQuery.RECEIPT_TYPE);
            }
            if (!string.IsNullOrEmpty(ReceiptRptQuery.StartDateTime))
            {
                sqlWhere.Add(" RECEIPT_DATE >= '" + ReceiptRptQuery.StartDateTime + "'");
            }
            if (!string.IsNullOrEmpty(ReceiptRptQuery.EndDateTime))
            {
                sqlWhere.Add(" RECEIPT_DATE <= '" + ReceiptRptQuery.EndDateTime + "'");
            }
            if (!string.IsNullOrEmpty(ReceiptRptQuery.SKU_CLASS_ID))
            {
                sqlWhere.Add(" SKU_CLASS_ID " + ReceiptRptQuery.SKU_CLASS_ID);
            }
            if (!string.IsNullOrEmpty(ReceiptRptQuery.SKU_ID))
            {
                sqlWhere.Add(" SKU_ID " + ReceiptRptQuery.SKU_ID);
            }
            if (!string.IsNullOrEmpty(ReceiptRptQuery.Descr))
            {
                sqlWhere.Add(" SKU_DESCR " + ReceiptRptQuery.Descr);
            }
            if (!string.IsNullOrEmpty(ReceiptRptQuery.VENDOR_ID))
            {
                sqlWhere.Add(" VENDOR_ID " + ReceiptRptQuery.VENDOR_ID);
            }
            if (!string.IsNullOrEmpty(ReceiptRptQuery.RMA))
            {
                sqlWhere.Add(" RMA " + ReceiptRptQuery.RMA);
            }
            return analyticsReportDA.GetReceiptRptInfo(sqlWhere, ReceiptRptQuery, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetRentWhDetailRptDataSet(RentWhDetailRptQueryEntity rentWhDetailRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(rentWhDetailRptQueryEntity.DEPARTMENT_ID))
            {
                sqlWhere.Add(" C.DEPARTMENT_ID " + rentWhDetailRptQueryEntity.DEPARTMENT_ID);
            }
            if (!string.IsNullOrEmpty(rentWhDetailRptQueryEntity.OWNER_ID))
            {
                sqlWhere.Add(" C.OWNER_ID " + rentWhDetailRptQueryEntity.OWNER_ID);
            }
            if (!string.IsNullOrEmpty(rentWhDetailRptQueryEntity.ZONE_NO))
            {
                sqlWhere.Add(" RHD.ZONE_NO " + rentWhDetailRptQueryEntity.ZONE_NO);
            }
            if (!string.IsNullOrEmpty(rentWhDetailRptQueryEntity.MANGAGE_TYPE))
            {
                sqlWhere.Add(" C.MANAGE_TYPE " + rentWhDetailRptQueryEntity.MANGAGE_TYPE);
            }
            return analyticsReportDA.GetRentWhDetailRptDataSet(sqlWhere, rentWhDetailRptQueryEntity, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetSafeInventoryRptInfo(SafeInventoryRptQueryEntity safeInventoryRptQuery)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(safeInventoryRptQuery.OWNER_ID))
            {
                sqlWhere.Add(" A.OWNER_ID " + safeInventoryRptQuery.OWNER_ID);
            }
            if (!string.IsNullOrEmpty(safeInventoryRptQuery.SKU_ID))
            {
                sqlWhere.Add("  A.SKU_ID " + safeInventoryRptQuery.SKU_ID);
            }
            if (!string.IsNullOrEmpty(safeInventoryRptQuery.SKU_CLASS_ID))
            {
                sqlWhere.Add(" A.SKU_CLASS_ID " + safeInventoryRptQuery.SKU_CLASS_ID);
            }
            if (!string.IsNullOrEmpty(safeInventoryRptQuery.VENDOR_ID))
            {
                sqlWhere.Add(" LA.VENDOR_ID " + safeInventoryRptQuery.VENDOR_ID);
            }
            return analyticsReportDA.GetSafeInventoryRptInfo(sqlWhere, safeInventoryRptQuery, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetShelflifeRptInfo(ShelflifeRptQueryEntity ShelflifeRptQuery)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(ShelflifeRptQuery.OWNER_ID))
            {
                sqlWhere.Add(" TEMP.OWNER_ID " + ShelflifeRptQuery.OWNER_ID);
            }
            if (!string.IsNullOrEmpty(ShelflifeRptQuery.SKU_CLASS_ID))
            {
                sqlWhere.Add(" TEMP.SKU_CLASS_ID " + ShelflifeRptQuery.SKU_CLASS_ID);
            }
            if (!string.IsNullOrEmpty(ShelflifeRptQuery.DESCR))
            {
                sqlWhere.Add(" TEMP.SKU_DESCR " + ShelflifeRptQuery.DESCR);
            }
            if (!string.IsNullOrEmpty(ShelflifeRptQuery.SKU_ID))
            {
                sqlWhere.Add(" TEMP.SKU_ID " + ShelflifeRptQuery.SKU_ID);
            }
            if (!string.IsNullOrEmpty(ShelflifeRptQuery.VENDOR_ID))
            {
                sqlWhere.Add(" TEMP.VENDOR_ID " + ShelflifeRptQuery.VENDOR_ID);
            }
            if (!string.IsNullOrEmpty(ShelflifeRptQuery.EXPECT_EXPIRY_DAYS))
            {
                sqlWhere.Add(" DATEDIFF(DAY, GETDATE(), TEMP.EXPIRY_DATE) <= " + ShelflifeRptQuery.EXPECT_EXPIRY_DAYS);
            }
            if (!string.IsNullOrEmpty(ShelflifeRptQuery.LOT_ATTR01))
            {
                sqlWhere.Add(" TEMP.LOT_ATTR01 " + ShelflifeRptQuery.LOT_ATTR01);
            }
            if (!string.IsNullOrEmpty(ShelflifeRptQuery.LOT_ATTR02))
            {
                sqlWhere.Add(" TEMP.LOT_ATTR02" + ShelflifeRptQuery.LOT_ATTR02);
            }
            if (!string.IsNullOrEmpty(ShelflifeRptQuery.LOT_ATTR03))
            {
                sqlWhere.Add(" TEMP.LOT_ATTR03" + ShelflifeRptQuery.LOT_ATTR03);
            }
            if (!string.IsNullOrEmpty(ShelflifeRptQuery.LOT_ATTR04))
            {
                sqlWhere.Add(" TEMP.LOT_ATTR04" + ShelflifeRptQuery.LOT_ATTR04);
            }
            if (!string.IsNullOrEmpty(ShelflifeRptQuery.LOT_ATTR05))
            {
                sqlWhere.Add(" TEMP.LOT_ATTR05" + ShelflifeRptQuery.LOT_ATTR05);
            }
            if (!string.IsNullOrEmpty(ShelflifeRptQuery.LOT_ATTR06))
            {
                sqlWhere.Add(" TEMP.LOT_ATTR06" + ShelflifeRptQuery.LOT_ATTR06);
            }
            if (!string.IsNullOrEmpty(ShelflifeRptQuery.LOT_ATTR07))
            {
                sqlWhere.Add(" TEMP.LOT_ATTR07" + ShelflifeRptQuery.LOT_ATTR07);
            }
            if (!string.IsNullOrEmpty(ShelflifeRptQuery.LOT_ATTR08))
            {
                sqlWhere.Add(" TEMP.LOT_ATTR08" + ShelflifeRptQuery.LOT_ATTR08);
            }
            if (!string.IsNullOrEmpty(ShelflifeRptQuery.LOT_ATTR09))
            {
                sqlWhere.Add(" TEMP.LOT_ATTR09" + ShelflifeRptQuery.LOT_ATTR09);
            }
            if (!string.IsNullOrEmpty(ShelflifeRptQuery.LOT_ATTR10))
            {
                sqlWhere.Add(" TEMP.LOT_ATTR10" + ShelflifeRptQuery.LOT_ATTR10);
            }
            if (!string.IsNullOrEmpty(ShelflifeRptQuery.PRODUCE_DATE))
            {
                sqlWhere.Add(ShelflifeRptQuery.PRODUCE_DATE.Replace("@ProduceDate@", " TEMP.PRODUCE_DATE "));
            }
            if (!string.IsNullOrEmpty(ShelflifeRptQuery.EXPIRY_DATE))
            {
                sqlWhere.Add(ShelflifeRptQuery.EXPIRY_DATE.Replace("@ExpiryDate@", " TEMP.EXPIRY_DATE "));
            }
            if (!string.IsNullOrEmpty(ShelflifeRptQuery.EXTERNAL_LOT))
            {
                sqlWhere.Add(" TEMP.EXTERNAL_LOT" + ShelflifeRptQuery.EXTERNAL_LOT);
            }
            sqlWhere.Add(" QTY > 0");
            return analyticsReportDA.GetShelflifeRptInfo(sqlWhere, ShelflifeRptQuery, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetShipmentOrderDetailRptInfo(ShipmentOrderDetailRptQueryEntity shipmentOrderDetailRptQuery)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(shipmentOrderDetailRptQuery.ORDER_ID))
            {
                sqlWhere.Add(" ORDER_ID " + shipmentOrderDetailRptQuery.ORDER_ID);
            }
            if (!string.IsNullOrEmpty(shipmentOrderDetailRptQuery.EXTERN_ORDER_ID))
            {
                sqlWhere.Add(" EXTERN_ORDER_ID " + shipmentOrderDetailRptQuery.EXTERN_ORDER_ID);
            }
            if (!string.IsNullOrEmpty(shipmentOrderDetailRptQuery.OWNER_ID))
            {
                sqlWhere.Add(" OWNER_ID " + shipmentOrderDetailRptQuery.OWNER_ID);
            }
            if (!string.IsNullOrEmpty(shipmentOrderDetailRptQuery.TYPE))
            {
                sqlWhere.Add(" ORDER_TYPE " + shipmentOrderDetailRptQuery.TYPE);
            }
            if (!string.IsNullOrEmpty(shipmentOrderDetailRptQuery.StartDateTime))
            {
                sqlWhere.Add(" ACTUAL_SHIP_DATE >= '" + shipmentOrderDetailRptQuery.StartDateTime + "'");
            }
            if (!string.IsNullOrEmpty(shipmentOrderDetailRptQuery.EndDateTime))
            {
                sqlWhere.Add(" ACTUAL_SHIP_DATE <= '" + shipmentOrderDetailRptQuery.EndDateTime + "'");
            }
            if (!string.IsNullOrEmpty(shipmentOrderDetailRptQuery.SKUCLASS_ID))
            {
                sqlWhere.Add(" SKU_CLASS_ID " + shipmentOrderDetailRptQuery.SKUCLASS_ID);
            }
            if (!string.IsNullOrEmpty(shipmentOrderDetailRptQuery.DESCR))
            {
                sqlWhere.Add(" DESCR " + shipmentOrderDetailRptQuery.DESCR);
            }
            if (!string.IsNullOrEmpty(shipmentOrderDetailRptQuery.SKU_ID))
            {
                sqlWhere.Add(" SKU_ID " + shipmentOrderDetailRptQuery.SKU_ID);
            }
            if (!string.IsNullOrEmpty(shipmentOrderDetailRptQuery.CONSIGNEE_ID))
            {
                sqlWhere.Add(" CONSIGNEE_ID " + shipmentOrderDetailRptQuery.CONSIGNEE_ID);
            }
            if (!string.IsNullOrEmpty(shipmentOrderDetailRptQuery.LOT_ATTR01))
            {
                sqlWhere.Add(" LOT_ATTR01 " + shipmentOrderDetailRptQuery.LOT_ATTR01);
            }
            if (!string.IsNullOrEmpty(shipmentOrderDetailRptQuery.LOT_ATTR02))
            {
                sqlWhere.Add(" LOT_ATTR02 " + shipmentOrderDetailRptQuery.LOT_ATTR02);
            }
            if (!string.IsNullOrEmpty(shipmentOrderDetailRptQuery.LOT_ATTR03))
            {
                sqlWhere.Add(" LOT_ATTR03 " + shipmentOrderDetailRptQuery.LOT_ATTR03);
            }
            if (!string.IsNullOrEmpty(shipmentOrderDetailRptQuery.LOT_ATTR04))
            {
                sqlWhere.Add(" LOT_ATTR04 " + shipmentOrderDetailRptQuery.LOT_ATTR04);
            }
            if (!string.IsNullOrEmpty(shipmentOrderDetailRptQuery.LOT_ATTR05))
            {
                sqlWhere.Add(" LOT_ATTR05 " + shipmentOrderDetailRptQuery.LOT_ATTR05);
            }
            if (!string.IsNullOrEmpty(shipmentOrderDetailRptQuery.LOT_ATTR06))
            {
                sqlWhere.Add(" LOT_ATTR06 " + shipmentOrderDetailRptQuery.LOT_ATTR06);
            }
            if (!string.IsNullOrEmpty(shipmentOrderDetailRptQuery.LOT_ATTR07))
            {
                sqlWhere.Add(" LOT_ATTR07 " + shipmentOrderDetailRptQuery.LOT_ATTR07);
            }
            if (!string.IsNullOrEmpty(shipmentOrderDetailRptQuery.LOT_ATTR08))
            {
                sqlWhere.Add(" LOT_ATTR08 " + shipmentOrderDetailRptQuery.LOT_ATTR08);
            }
            if (!string.IsNullOrEmpty(shipmentOrderDetailRptQuery.LOT_ATTR09))
            {
                sqlWhere.Add(" LOT_ATTR09 " + shipmentOrderDetailRptQuery.LOT_ATTR09);
            }
            if (!string.IsNullOrEmpty(shipmentOrderDetailRptQuery.LOT_ATTR10))
            {
                sqlWhere.Add(" LOT_ATTR10 " + shipmentOrderDetailRptQuery.LOT_ATTR10);
            }
            if (!string.IsNullOrEmpty(shipmentOrderDetailRptQuery.WAVE_ID))
            {
                sqlWhere.Add(" WAVE_ID " + shipmentOrderDetailRptQuery.WAVE_ID);
            }
            if (!string.IsNullOrEmpty(shipmentOrderDetailRptQuery.PRODUCE_DATE))
            {
                sqlWhere.Add(shipmentOrderDetailRptQuery.PRODUCE_DATE.Replace("@ProduceDate@", " PRODUCE_DATE "));
            }
            if (!string.IsNullOrEmpty(shipmentOrderDetailRptQuery.EXPIRY_DATE))
            {
                sqlWhere.Add(shipmentOrderDetailRptQuery.EXPIRY_DATE.Replace("@ExpiryDate@", " EXPIRY_DATE "));
            }
            if (!string.IsNullOrEmpty(shipmentOrderDetailRptQuery.EXTERNAL_LOT))
            {
                sqlWhere.Add(" EXTERNAL_LOT " + shipmentOrderDetailRptQuery.EXTERNAL_LOT);
            }
            if (!string.IsNullOrEmpty(shipmentOrderDetailRptQuery.VENDOR_ID))
            {
                sqlWhere.Add(" VENDOR_ID " + shipmentOrderDetailRptQuery.VENDOR_ID);
            }
            sqlWhere.Add(" OD_STATUS  in ('PartShipped','Shipped')");
            return analyticsReportDA.GetShipmentOrderDetailRptInfo(sqlWhere, shipmentOrderDetailRptQuery, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetShipmentOrderRptInfo(ShipmentOrderRptQueryEntity shipmentOrderRptQuery)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(shipmentOrderRptQuery.ORDER_ID))
            {
                sqlWhere.Add(" OD.ORDER_ID " + shipmentOrderRptQuery.ORDER_ID);
            }
            if (!string.IsNullOrEmpty(shipmentOrderRptQuery.EXTERN_ORDER_ID))
            {
                sqlWhere.Add(" O.EXTERN_ORDER_ID " + shipmentOrderRptQuery.EXTERN_ORDER_ID);
            }
            if (!string.IsNullOrEmpty(shipmentOrderRptQuery.EXTERNAL_ORDER_ID2))
            {
                sqlWhere.Add(" O.EXTERNAL_ORDER_ID2 " + shipmentOrderRptQuery.EXTERNAL_ORDER_ID2);
            }
            if (!string.IsNullOrEmpty(shipmentOrderRptQuery.OWNER_ID))
            {
                sqlWhere.Add(" OD.OWNER_ID " + shipmentOrderRptQuery.OWNER_ID);
            }
            if (!string.IsNullOrEmpty(shipmentOrderRptQuery.SKU_ID))
            {
                sqlWhere.Add(" SKU.SKU_ID " + shipmentOrderRptQuery.SKU_ID);
            }
            if (!string.IsNullOrEmpty(shipmentOrderRptQuery.SKUCLASS_ID))
            {
                sqlWhere.Add(" SKU.SKU_CLASS_ID " + shipmentOrderRptQuery.SKUCLASS_ID);
            }
            if (!string.IsNullOrEmpty(shipmentOrderRptQuery.TYPE))
            {
                sqlWhere.Add(" O.TYPE " + shipmentOrderRptQuery.TYPE);
            }
            if (!string.IsNullOrEmpty(shipmentOrderRptQuery.StartDateTime))
            {
                sqlWhere.Add(" O.ACTUAL_SHIP_DATE >= '" + Convert.ToDateTime(shipmentOrderRptQuery.StartDateTime).ToString("yyyy-MM-dd") + " 00:00:00'");
            }
            if (!string.IsNullOrEmpty(shipmentOrderRptQuery.EndDateTime))
            {
                sqlWhere.Add(" O.ACTUAL_SHIP_DATE <= '" + Convert.ToDateTime(shipmentOrderRptQuery.EndDateTime).ToString("yyyy-MM-dd") + " 23:59:59'");
            }
            if (!string.IsNullOrEmpty(shipmentOrderRptQuery.DESCR))
            {
                sqlWhere.Add(" SKU.DESCR " + shipmentOrderRptQuery.DESCR);
            }
            if (!string.IsNullOrEmpty(shipmentOrderRptQuery.CONSIGNEE_ID))
            {
                sqlWhere.Add(" O.CONSIGNEE_ID " + shipmentOrderRptQuery.CONSIGNEE_ID);
            }
            if (!string.IsNullOrEmpty(shipmentOrderRptQuery.LOT_ATTR01))
            {
                sqlWhere.Add(" LA.LOT_ATTR01 " + shipmentOrderRptQuery.LOT_ATTR01);
            }
            if (!string.IsNullOrEmpty(shipmentOrderRptQuery.LOT_ATTR02))
            {
                sqlWhere.Add(" LA.LOT_ATTR02 " + shipmentOrderRptQuery.LOT_ATTR02);
            }
            if (!string.IsNullOrEmpty(shipmentOrderRptQuery.LOT_ATTR03))
            {
                sqlWhere.Add(" LA.LOT_ATTR03 " + shipmentOrderRptQuery.LOT_ATTR03);
            }
            if (!string.IsNullOrEmpty(shipmentOrderRptQuery.LOT_ATTR04))
            {
                sqlWhere.Add(" LA.LOT_ATTR04 " + shipmentOrderRptQuery.LOT_ATTR04);
            }
            if (!string.IsNullOrEmpty(shipmentOrderRptQuery.LOT_ATTR05))
            {
                sqlWhere.Add(" LA.LOT_ATTR05 " + shipmentOrderRptQuery.LOT_ATTR05);
            }
            if (!string.IsNullOrEmpty(shipmentOrderRptQuery.LOT_ATTR06))
            {
                sqlWhere.Add(" LA.LOT_ATTR06 " + shipmentOrderRptQuery.LOT_ATTR06);
            }
            if (!string.IsNullOrEmpty(shipmentOrderRptQuery.LOT_ATTR07))
            {
                sqlWhere.Add(" LA.LOT_ATTR07 " + shipmentOrderRptQuery.LOT_ATTR07);
            }
            if (!string.IsNullOrEmpty(shipmentOrderRptQuery.LOT_ATTR08))
            {
                sqlWhere.Add(" LA.LOT_ATTR08 " + shipmentOrderRptQuery.LOT_ATTR08);
            }
            if (!string.IsNullOrEmpty(shipmentOrderRptQuery.LOT_ATTR09))
            {
                sqlWhere.Add(" LA.LOT_ATTR09 " + shipmentOrderRptQuery.LOT_ATTR09);
            }
            if (!string.IsNullOrEmpty(shipmentOrderRptQuery.LOT_ATTR10))
            {
                sqlWhere.Add(" LA.LOT_ATTR10 " + shipmentOrderRptQuery.LOT_ATTR10);
            }
            return analyticsReportDA.GetShipmentOrderRptInfo(sqlWhere, shipmentOrderRptQuery, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetShipmentOrderRptStatistics(ShipmentOrderRptQueryEntity shipmentOrderRptQuery)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(shipmentOrderRptQuery.ORDER_ID))
            {
                sqlWhere.Add(" OD.ORDER_ID " + shipmentOrderRptQuery.ORDER_ID);
            }
            if (!string.IsNullOrEmpty(shipmentOrderRptQuery.EXTERN_ORDER_ID))
            {
                sqlWhere.Add(" O.EXTERN_ORDER_ID " + shipmentOrderRptQuery.EXTERN_ORDER_ID);
            }
            if (!string.IsNullOrEmpty(shipmentOrderRptQuery.EXTERNAL_ORDER_ID2))
            {
                sqlWhere.Add(" O.EXTERNAL_ORDER_ID2 " + shipmentOrderRptQuery.EXTERNAL_ORDER_ID2);
            }
            if (!string.IsNullOrEmpty(shipmentOrderRptQuery.OWNER_ID))
            {
                sqlWhere.Add(" OD.OWNER_ID " + shipmentOrderRptQuery.OWNER_ID);
            }
            if (!string.IsNullOrEmpty(shipmentOrderRptQuery.SKU_ID))
            {
                sqlWhere.Add(" SKU.SKU_ID " + shipmentOrderRptQuery.SKU_ID);
            }
            if (!string.IsNullOrEmpty(shipmentOrderRptQuery.SKUCLASS_ID))
            {
                sqlWhere.Add(" SKU.SKU_CLASS_ID " + shipmentOrderRptQuery.SKUCLASS_ID);
            }
            if (!string.IsNullOrEmpty(shipmentOrderRptQuery.TYPE))
            {
                sqlWhere.Add(" O.TYPE " + shipmentOrderRptQuery.TYPE);
            }
            if (!string.IsNullOrEmpty(shipmentOrderRptQuery.StartDateTime))
            {
                sqlWhere.Add(" O.ACTUAL_SHIP_DATE >= '" + Convert.ToDateTime(shipmentOrderRptQuery.StartDateTime).ToString("yyyy-MM-dd") + " 00:00:00'");
            }
            if (!string.IsNullOrEmpty(shipmentOrderRptQuery.EndDateTime))
            {
                sqlWhere.Add(" O.ACTUAL_SHIP_DATE <= '" + Convert.ToDateTime(shipmentOrderRptQuery.EndDateTime).ToString("yyyy-MM-dd") + " 23:59:59'");
            }
            if (!string.IsNullOrEmpty(shipmentOrderRptQuery.DESCR))
            {
                sqlWhere.Add(" SKU.DESCR " + shipmentOrderRptQuery.DESCR);
            }
            if (!string.IsNullOrEmpty(shipmentOrderRptQuery.CONSIGNEE_ID))
            {
                sqlWhere.Add(" O.CONSIGNEE_ID " + shipmentOrderRptQuery.CONSIGNEE_ID);
            }
            return analyticsReportDA.GetShipmentOrderRptStatistics(sqlWhere, shipmentOrderRptQuery, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetShipmentOrderStatusRptInfo(ShipmentOrderStatusRptQueryEntity shipmentOrderStatusRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(shipmentOrderStatusRptQueryEntity.ORDER_ID))
            {
                sqlWhere.Add(" Os.ORDER_ID " + shipmentOrderStatusRptQueryEntity.ORDER_ID);
            }
            if (!string.IsNullOrEmpty(shipmentOrderStatusRptQueryEntity.EXTERN_ORDER_ID))
            {
                sqlWhere.Add(" Os.EXTERN_ORDER_ID " + shipmentOrderStatusRptQueryEntity.EXTERN_ORDER_ID);
            }
            if (!string.IsNullOrEmpty(shipmentOrderStatusRptQueryEntity.OWNER_ID))
            {
                sqlWhere.Add(" Os.OWNER_ID " + shipmentOrderStatusRptQueryEntity.OWNER_ID);
            }
            if (!string.IsNullOrEmpty(shipmentOrderStatusRptQueryEntity.CONSIGNEE_ID))
            {
                sqlWhere.Add(" Os.CONSIGNEE_ID " + shipmentOrderStatusRptQueryEntity.CONSIGNEE_ID);
            }
            if (!string.IsNullOrEmpty(shipmentOrderStatusRptQueryEntity.TYPE))
            {
                sqlWhere.Add(" Os.TYPE " + shipmentOrderStatusRptQueryEntity.TYPE);
            }
            if (!string.IsNullOrEmpty(shipmentOrderStatusRptQueryEntity.STATUS))
            {
                sqlWhere.Add(" Os.STATUS " + shipmentOrderStatusRptQueryEntity.STATUS);
            }
            if (!string.IsNullOrEmpty(shipmentOrderStatusRptQueryEntity.StartTime))
            {
                sqlWhere.Add(" Os.ACTUAL_SHIP_DATE   >= '" + shipmentOrderStatusRptQueryEntity.StartTime + "'");
            }
            if (!string.IsNullOrEmpty(shipmentOrderStatusRptQueryEntity.EndTime))
            {
                sqlWhere.Add(" Os.ACTUAL_SHIP_DATE <= '" + shipmentOrderStatusRptQueryEntity.EndTime + "'");
            }
            return analyticsReportDA.GetShipmentOrderStatusRptInfo(sqlWhere, shipmentOrderStatusRptQueryEntity, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetShipmentStatByCustomerRptDataSet(ShipmentStatByCustomerRptQueryEntity shipmentStatByCustomerRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(shipmentStatByCustomerRptQueryEntity.OWNER_ID))
            {
                sqlWhere.Add(" O.OWNER_ID " + shipmentStatByCustomerRptQueryEntity.OWNER_ID);
            }
            if (!string.IsNullOrEmpty(shipmentStatByCustomerRptQueryEntity.StartDateTime))
            {
                sqlWhere.Add(" O.ACTUAL_SHIP_DATE >= '" + shipmentStatByCustomerRptQueryEntity.StartDateTime + "'");
            }
            if (!string.IsNullOrEmpty(shipmentStatByCustomerRptQueryEntity.EndDateTime))
            {
                sqlWhere.Add(" O.ACTUAL_SHIP_DATE <= '" + shipmentStatByCustomerRptQueryEntity.EndDateTime + "'");
            }
            return analyticsReportDA.GetShipmentStatByCustomerRptDataSet(sqlWhere, shipmentStatByCustomerRptQueryEntity, this.pubParasInfo, this.dataBaseID[0]);
        }

        public DataSet GetShipmentStatByOrderRptDataSet(ShipmentStatByOrderRptQueryEntity shipmentStatByOrderRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(shipmentStatByOrderRptQueryEntity.ORDER_ID))
            {
                sqlWhere.Add(" O.ORDER_ID " + shipmentStatByOrderRptQueryEntity.ORDER_ID);
            }
            if (!string.IsNullOrEmpty(shipmentStatByOrderRptQueryEntity.EXTERN_ORDER_ID))
            {
                sqlWhere.Add(" O.EXTERN_ORDER_ID " + shipmentStatByOrderRptQueryEntity.EXTERN_ORDER_ID);
            }
            if (!string.IsNullOrEmpty(shipmentStatByOrderRptQueryEntity.REFERENCE_NUM))
            {
                sqlWhere.Add(" O.REFERENCE_NUM " + shipmentStatByOrderRptQueryEntity.REFERENCE_NUM);
            }
            if (!string.IsNullOrEmpty(shipmentStatByOrderRptQueryEntity.OWNER_ID))
            {
                sqlWhere.Add(" O.OWNER_ID " + shipmentStatByOrderRptQueryEntity.OWNER_ID);
            }
            if (!string.IsNullOrEmpty(shipmentStatByOrderRptQueryEntity.CUSTOMER_ID))
            {
                sqlWhere.Add(" O.CONSIGNEE_ID " + shipmentStatByOrderRptQueryEntity.CUSTOMER_ID);
            }
            if (!string.IsNullOrEmpty(shipmentStatByOrderRptQueryEntity.TYPE))
            {
                sqlWhere.Add(" T2.[TEXT] " + shipmentStatByOrderRptQueryEntity.TYPE);
            }
            if (!string.IsNullOrEmpty(shipmentStatByOrderRptQueryEntity.StartDateTime))
            {
                sqlWhere.Add(" O.ACTUAL_SHIP_DATE >= '" + shipmentStatByOrderRptQueryEntity.StartDateTime + "'");
            }
            if (!string.IsNullOrEmpty(shipmentStatByOrderRptQueryEntity.EndDateTime))
            {
                sqlWhere.Add(" O.ACTUAL_SHIP_DATE <= '" + shipmentStatByOrderRptQueryEntity.EndDateTime + "'");
            }
            return analyticsReportDA.GetShipmentStatByOrderRptDataSet(sqlWhere, shipmentStatByOrderRptQueryEntity, this.pubParasInfo, this.dataBaseID[0]);
        }

        public DataSet GetShipmentStatSplitCustomerRptDataSet(ShipmentStatSplitCustomerRptQueryEntity shipmentStatSplitCustomerRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(shipmentStatSplitCustomerRptQueryEntity.SKU_CLASS_ID))
            {
                sqlWhere.Add(" S.SKU_CLASS_ID " + shipmentStatSplitCustomerRptQueryEntity.SKU_CLASS_ID);
            }
            if (!string.IsNullOrEmpty(shipmentStatSplitCustomerRptQueryEntity.EXTERNAL_LOT))
            {
                sqlWhere.Add("LA.EXTERNAL_LOT " + shipmentStatSplitCustomerRptQueryEntity.EXTERNAL_LOT);
            }
            if (!string.IsNullOrEmpty(shipmentStatSplitCustomerRptQueryEntity.LOT_ATTR01))
            {
                sqlWhere.Add(" LA.LOT_ATTR01 " + shipmentStatSplitCustomerRptQueryEntity.LOT_ATTR01);
            }
            if (!string.IsNullOrEmpty(shipmentStatSplitCustomerRptQueryEntity.LOT_ATTR02))
            {
                sqlWhere.Add(" LA.LOT_ATTR02" + shipmentStatSplitCustomerRptQueryEntity.LOT_ATTR02);
            }
            if (!string.IsNullOrEmpty(shipmentStatSplitCustomerRptQueryEntity.LOT_ATTR03))
            {
                sqlWhere.Add(" LA.LOT_ATTR03" + shipmentStatSplitCustomerRptQueryEntity.LOT_ATTR03);
            }
            if (!string.IsNullOrEmpty(shipmentStatSplitCustomerRptQueryEntity.LOT_ATTR04))
            {
                sqlWhere.Add(" LA.LOT_ATTR04" + shipmentStatSplitCustomerRptQueryEntity.LOT_ATTR04);
            }
            if (!string.IsNullOrEmpty(shipmentStatSplitCustomerRptQueryEntity.LOT_ATTR05))
            {
                sqlWhere.Add(" LA.LOT_ATTR05" + shipmentStatSplitCustomerRptQueryEntity.LOT_ATTR05);
            }
            if (!string.IsNullOrEmpty(shipmentStatSplitCustomerRptQueryEntity.LOT_ATTR06))
            {
                sqlWhere.Add(" LA.LOT_ATTR06" + shipmentStatSplitCustomerRptQueryEntity.LOT_ATTR06);
            }
            if (!string.IsNullOrEmpty(shipmentStatSplitCustomerRptQueryEntity.LOT_ATTR07))
            {
                sqlWhere.Add(" LA.LOT_ATTR07" + shipmentStatSplitCustomerRptQueryEntity.LOT_ATTR07);
            }
            if (!string.IsNullOrEmpty(shipmentStatSplitCustomerRptQueryEntity.LOT_ATTR08))
            {
                sqlWhere.Add(" LA.LOT_ATTR08" + shipmentStatSplitCustomerRptQueryEntity.LOT_ATTR08);
            }
            if (!string.IsNullOrEmpty(shipmentStatSplitCustomerRptQueryEntity.LOT_ATTR09))
            {
                sqlWhere.Add(" LA.LOT_ATTR09" + shipmentStatSplitCustomerRptQueryEntity.LOT_ATTR09);
            }
            if (!string.IsNullOrEmpty(shipmentStatSplitCustomerRptQueryEntity.LOT_ATTR10))
            {
                sqlWhere.Add(" LA.LOT_ATTR10" + shipmentStatSplitCustomerRptQueryEntity.LOT_ATTR10);
            }
            if (!string.IsNullOrEmpty(shipmentStatSplitCustomerRptQueryEntity.PRODUCE_DATE))
            {
                sqlWhere.Add(shipmentStatSplitCustomerRptQueryEntity.PRODUCE_DATE.Replace("@ProduceDate@", " LA.PRODUCE_DATE "));
            }
            if (!string.IsNullOrEmpty(shipmentStatSplitCustomerRptQueryEntity.EXPIRY_DATE))
            {
                sqlWhere.Add(shipmentStatSplitCustomerRptQueryEntity.EXPIRY_DATE.Replace("@ExpiryDate@", " LA.EXPIRY_DATE "));
            }
            return analyticsReportDA.GetShipmentStatSplitCustomerRptDataSet(sqlWhere, shipmentStatSplitCustomerRptQueryEntity, this.pubParasInfo, this.dataBaseID[0]);
        }

        public DataSet GetStatementRptDataSet(StatementRptQueryEntity statementRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(statementRptQueryEntity.OwnerID))
            {
                sqlWhere.Add(" A.OWNER_ID " + statementRptQueryEntity.OwnerID);
            }
            if (!string.IsNullOrEmpty(statementRptQueryEntity.StatementDate))
            {
                sqlWhere.Add(" A.STATEMENT_DATE " + statementRptQueryEntity.StatementDate);
            }
            return analyticsReportDA.GetStatementRptDataSet(sqlWhere, statementRptQueryEntity, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetStockRptInfo(StockRptQueryEntity stockRptQuery)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(stockRptQuery.OWNER_ID))
            {
                sqlWhere.Add(" OWNER_ID " + stockRptQuery.OWNER_ID);
            }
            if (!string.IsNullOrEmpty(stockRptQuery.SKU_ID))
            {
                sqlWhere.Add(" SKU_ID " + stockRptQuery.SKU_ID);
            }
            if (!string.IsNullOrEmpty(stockRptQuery.DESCR))
            {
                sqlWhere.Add(" DESCR " + stockRptQuery.DESCR);
            }
            if (!string.IsNullOrEmpty(stockRptQuery.SKU_CLASS_ID))
            {
                sqlWhere.Add(" SKU_CLASS_ID " + stockRptQuery.SKU_CLASS_ID);
            }
            if (!string.IsNullOrEmpty(stockRptQuery.VENDOR_ID))
            {
                sqlWhere.Add(" VENDOR_ID " + stockRptQuery.VENDOR_ID);
            }
            if (!string.IsNullOrEmpty(stockRptQuery.EXTERNAL_LOT))
            {
                sqlWhere.Add(" EXTERNAL_LOT " + stockRptQuery.EXTERNAL_LOT);
            }
            if (!string.IsNullOrEmpty(stockRptQuery.LOT))
            {
                sqlWhere.Add(" LOT " + stockRptQuery.LOT);
            }
            if (!string.IsNullOrEmpty(stockRptQuery.LOC_ID))
            {
                sqlWhere.Add(" LOC " + stockRptQuery.LOC_ID);
            }
            if (!string.IsNullOrEmpty(stockRptQuery.LPN_ID))
            {
                sqlWhere.Add(" LPN_ID " + stockRptQuery.LPN_ID);
            }
            if (!string.IsNullOrEmpty(stockRptQuery.LOT_ATTR01))
            {
                sqlWhere.Add(" LOT_ATTR01 " + stockRptQuery.LOT_ATTR01);
            }
            if (!string.IsNullOrEmpty(stockRptQuery.LOT_ATTR02))
            {
                sqlWhere.Add(" LOT_ATTR02" + stockRptQuery.LOT_ATTR02);
            }
            if (!string.IsNullOrEmpty(stockRptQuery.LOT_ATTR03))
            {
                sqlWhere.Add(" LOT_ATTR03" + stockRptQuery.LOT_ATTR03);
            }
            if (!string.IsNullOrEmpty(stockRptQuery.LOT_ATTR04))
            {
                sqlWhere.Add(" LOT_ATTR04" + stockRptQuery.LOT_ATTR04);
            }
            if (!string.IsNullOrEmpty(stockRptQuery.LOT_ATTR05))
            {
                sqlWhere.Add(" LOT_ATTR05" + stockRptQuery.LOT_ATTR05);
            }
            if (!string.IsNullOrEmpty(stockRptQuery.LOT_ATTR06))
            {
                sqlWhere.Add(" LOT_ATTR06" + stockRptQuery.LOT_ATTR06);
            }
            if (!string.IsNullOrEmpty(stockRptQuery.LOT_ATTR07))
            {
                sqlWhere.Add(" LOT_ATTR07" + stockRptQuery.LOT_ATTR07);
            }
            if (!string.IsNullOrEmpty(stockRptQuery.LOT_ATTR08))
            {
                sqlWhere.Add(" LOT_ATTR08" + stockRptQuery.LOT_ATTR08);
            }
            if (!string.IsNullOrEmpty(stockRptQuery.LOT_ATTR09))
            {
                sqlWhere.Add(" LOT_ATTR09" + stockRptQuery.LOT_ATTR09);
            }
            if (!string.IsNullOrEmpty(stockRptQuery.LOT_ATTR10))
            {
                sqlWhere.Add(" LOT_ATTR10" + stockRptQuery.LOT_ATTR10);
            }
            if (!string.IsNullOrEmpty(stockRptQuery.RECEIPT_DATE))
            {
                sqlWhere.Add(stockRptQuery.RECEIPT_DATE.Replace("@ReceiptDate@", " RECEIPT_DATE "));
            }
            return analyticsReportDA.GetStockRptInfo(sqlWhere, stockRptQuery, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GetVendorReturnDetailRptDataSet(VendorReturnDetailRptQueryEntity vendorReturnDetailRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(vendorReturnDetailRptQueryEntity.OWNER_ID))
            {
                sqlWhere.Add(" PD.OWNER_ID " + vendorReturnDetailRptQueryEntity.OWNER_ID);
            }
            if (!string.IsNullOrEmpty(vendorReturnDetailRptQueryEntity.SKU_CLASS_ID))
            {
                sqlWhere.Add(" S.SKU_CLASS_ID " + vendorReturnDetailRptQueryEntity.SKU_CLASS_ID);
            }
            if (!string.IsNullOrEmpty(vendorReturnDetailRptQueryEntity.SKU_ID))
            {
                sqlWhere.Add(" PD.SKU_ID " + vendorReturnDetailRptQueryEntity.SKU_ID);
            }
            if (!string.IsNullOrEmpty(vendorReturnDetailRptQueryEntity.SKU_DESCR))
            {
                sqlWhere.Add(" S.DESCR " + vendorReturnDetailRptQueryEntity.SKU_DESCR);
            }
            if (!string.IsNullOrEmpty(vendorReturnDetailRptQueryEntity.VENDOR_ID))
            {
                sqlWhere.Add(" O.CONSIGNEE_ID " + vendorReturnDetailRptQueryEntity.VENDOR_ID);
            }
            if (!string.IsNullOrEmpty(vendorReturnDetailRptQueryEntity.VENDOR_NAME))
            {
                sqlWhere.Add(" O.C_COMPANY " + vendorReturnDetailRptQueryEntity.VENDOR_NAME);
            }
            if (!string.IsNullOrEmpty(vendorReturnDetailRptQueryEntity.StartTime))
            {
                sqlWhere.Add(" O.ORDER_DATE >= '" + vendorReturnDetailRptQueryEntity.StartTime + "'");
            }
            if (!string.IsNullOrEmpty(vendorReturnDetailRptQueryEntity.EndTime))
            {
                sqlWhere.Add(" O.ORDER_DATE <= '" + vendorReturnDetailRptQueryEntity.EndTime + "'");
            }
            if (!string.IsNullOrEmpty(vendorReturnDetailRptQueryEntity.EXTERNAL_LOT))
            {
                sqlWhere.Add("LA.EXTERNAL_LOT " + vendorReturnDetailRptQueryEntity.EXTERNAL_LOT);
            }
            if (!string.IsNullOrEmpty(vendorReturnDetailRptQueryEntity.LOT_ATTR01))
            {
                sqlWhere.Add(" LA.LOT_ATTR01 " + vendorReturnDetailRptQueryEntity.LOT_ATTR01);
            }
            if (!string.IsNullOrEmpty(vendorReturnDetailRptQueryEntity.LOT_ATTR02))
            {
                sqlWhere.Add(" LA.LOT_ATTR02" + vendorReturnDetailRptQueryEntity.LOT_ATTR02);
            }
            if (!string.IsNullOrEmpty(vendorReturnDetailRptQueryEntity.LOT_ATTR03))
            {
                sqlWhere.Add(" LA.LOT_ATTR03" + vendorReturnDetailRptQueryEntity.LOT_ATTR03);
            }
            if (!string.IsNullOrEmpty(vendorReturnDetailRptQueryEntity.LOT_ATTR04))
            {
                sqlWhere.Add(" LA.LOT_ATTR04" + vendorReturnDetailRptQueryEntity.LOT_ATTR04);
            }
            if (!string.IsNullOrEmpty(vendorReturnDetailRptQueryEntity.LOT_ATTR05))
            {
                sqlWhere.Add(" LA.LOT_ATTR05" + vendorReturnDetailRptQueryEntity.LOT_ATTR05);
            }
            if (!string.IsNullOrEmpty(vendorReturnDetailRptQueryEntity.LOT_ATTR06))
            {
                sqlWhere.Add(" LA.LOT_ATTR06" + vendorReturnDetailRptQueryEntity.LOT_ATTR06);
            }
            if (!string.IsNullOrEmpty(vendorReturnDetailRptQueryEntity.LOT_ATTR07))
            {
                sqlWhere.Add(" LA.LOT_ATTR07" + vendorReturnDetailRptQueryEntity.LOT_ATTR07);
            }
            if (!string.IsNullOrEmpty(vendorReturnDetailRptQueryEntity.LOT_ATTR08))
            {
                sqlWhere.Add(" LA.LOT_ATTR08" + vendorReturnDetailRptQueryEntity.LOT_ATTR08);
            }
            if (!string.IsNullOrEmpty(vendorReturnDetailRptQueryEntity.LOT_ATTR09))
            {
                sqlWhere.Add(" LA.LOT_ATTR09" + vendorReturnDetailRptQueryEntity.LOT_ATTR09);
            }
            if (!string.IsNullOrEmpty(vendorReturnDetailRptQueryEntity.LOT_ATTR10))
            {
                sqlWhere.Add(" LA.LOT_ATTR10" + vendorReturnDetailRptQueryEntity.LOT_ATTR10);
            }
            if (!string.IsNullOrEmpty(vendorReturnDetailRptQueryEntity.PRODUCE_DATE))
            {
                sqlWhere.Add(vendorReturnDetailRptQueryEntity.PRODUCE_DATE.Replace("@ProduceDate@", " LA.PRODUCE_DATE "));
            }
            if (!string.IsNullOrEmpty(vendorReturnDetailRptQueryEntity.EXPIRY_DATE))
            {
                sqlWhere.Add(vendorReturnDetailRptQueryEntity.EXPIRY_DATE.Replace("@ExpiryDate@", " LA.EXPIRY_DATE "));
            }
            return analyticsReportDA.GetVendorReturnDetailRptDataSet(sqlWhere, vendorReturnDetailRptQueryEntity, this.pubParasInfo, this.dataBaseID[0]);
        }

        public DataSet GetWarehouseTransferRptDateSet(WarehouseTransferRptQueryEntity warehouseTransferRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(warehouseTransferRptQueryEntity.IntransitID))
            {
                sqlWhere.Add(" I.INTRANSIT_ID " + warehouseTransferRptQueryEntity.IntransitID);
            }
            if (!string.IsNullOrEmpty(warehouseTransferRptQueryEntity.SrcWhDbID))
            {
                sqlWhere.Add(" I.SRC_WH_DB_ID " + warehouseTransferRptQueryEntity.SrcWhDbID);
            }
            if (!string.IsNullOrEmpty(warehouseTransferRptQueryEntity.DestWhDbID))
            {
                sqlWhere.Add(" I.DEST_WH_DB_ID " + warehouseTransferRptQueryEntity.DestWhDbID);
            }
            if (!string.IsNullOrEmpty(warehouseTransferRptQueryEntity.OwnerID))
            {
                sqlWhere.Add(" ID.OWNER_ID " + warehouseTransferRptQueryEntity.OwnerID);
            }
            if (!string.IsNullOrEmpty(warehouseTransferRptQueryEntity.SkuClassID))
            {
                sqlWhere.Add(" S.SKU_CLASS_ID " + warehouseTransferRptQueryEntity.SkuClassID);
            }
            if (!string.IsNullOrEmpty(warehouseTransferRptQueryEntity.SkuID))
            {
                sqlWhere.Add(" S.SKU_ID " + warehouseTransferRptQueryEntity.SkuID);
            }
            if (!string.IsNullOrEmpty(warehouseTransferRptQueryEntity.Descr))
            {
                sqlWhere.Add(" S.DESCR " + warehouseTransferRptQueryEntity.Descr);
            }
            if (!string.IsNullOrEmpty(warehouseTransferRptQueryEntity.OrderID))
            {
                sqlWhere.Add(" I.ORDER_ID " + warehouseTransferRptQueryEntity.OrderID);
            }
            if (!string.IsNullOrEmpty(warehouseTransferRptQueryEntity.ReceiptID))
            {
                sqlWhere.Add(" I.RECEIPT_ID " + warehouseTransferRptQueryEntity.ReceiptID);
            }
            if (!string.IsNullOrEmpty(warehouseTransferRptQueryEntity.ActualShipDate))
            {
                sqlWhere.Add(" I.ACTUAL_SHIP_DATE " + warehouseTransferRptQueryEntity.ActualShipDate);
            }
            if (!string.IsNullOrEmpty(warehouseTransferRptQueryEntity.EXTERNAL_LOT))
            {
                sqlWhere.Add("LA.EXTERNAL_LOT " + warehouseTransferRptQueryEntity.EXTERNAL_LOT);
            }
            if (!string.IsNullOrEmpty(warehouseTransferRptQueryEntity.LOT_ATTR01))
            {
                sqlWhere.Add(" LA.LOT_ATTR01 " + warehouseTransferRptQueryEntity.LOT_ATTR01);
            }
            if (!string.IsNullOrEmpty(warehouseTransferRptQueryEntity.LOT_ATTR02))
            {
                sqlWhere.Add(" LA.LOT_ATTR02" + warehouseTransferRptQueryEntity.LOT_ATTR02);
            }
            if (!string.IsNullOrEmpty(warehouseTransferRptQueryEntity.LOT_ATTR03))
            {
                sqlWhere.Add(" LA.LOT_ATTR03" + warehouseTransferRptQueryEntity.LOT_ATTR03);
            }
            if (!string.IsNullOrEmpty(warehouseTransferRptQueryEntity.LOT_ATTR04))
            {
                sqlWhere.Add(" LA.LOT_ATTR04" + warehouseTransferRptQueryEntity.LOT_ATTR04);
            }
            if (!string.IsNullOrEmpty(warehouseTransferRptQueryEntity.LOT_ATTR05))
            {
                sqlWhere.Add(" LA.LOT_ATTR05" + warehouseTransferRptQueryEntity.LOT_ATTR05);
            }
            if (!string.IsNullOrEmpty(warehouseTransferRptQueryEntity.LOT_ATTR06))
            {
                sqlWhere.Add(" LA.LOT_ATTR06" + warehouseTransferRptQueryEntity.LOT_ATTR06);
            }
            if (!string.IsNullOrEmpty(warehouseTransferRptQueryEntity.LOT_ATTR07))
            {
                sqlWhere.Add(" LA.LOT_ATTR07" + warehouseTransferRptQueryEntity.LOT_ATTR07);
            }
            if (!string.IsNullOrEmpty(warehouseTransferRptQueryEntity.LOT_ATTR08))
            {
                sqlWhere.Add(" LA.LOT_ATTR08" + warehouseTransferRptQueryEntity.LOT_ATTR08);
            }
            if (!string.IsNullOrEmpty(warehouseTransferRptQueryEntity.LOT_ATTR09))
            {
                sqlWhere.Add(" LA.LOT_ATTR09" + warehouseTransferRptQueryEntity.LOT_ATTR09);
            }
            if (!string.IsNullOrEmpty(warehouseTransferRptQueryEntity.LOT_ATTR10))
            {
                sqlWhere.Add(" LA.LOT_ATTR10" + warehouseTransferRptQueryEntity.LOT_ATTR10);
            }
            if (!string.IsNullOrEmpty(warehouseTransferRptQueryEntity.PRODUCE_DATE))
            {
                sqlWhere.Add("  LA.PRODUCE_DATE " + warehouseTransferRptQueryEntity.PRODUCE_DATE);
            }
            if (!string.IsNullOrEmpty(warehouseTransferRptQueryEntity.EXPIRY_DATE))
            {
                sqlWhere.Add("  LA.EXPIRY_DATE " + warehouseTransferRptQueryEntity.EXPIRY_DATE);
            }
            return analyticsReportDA.GetWarehouseTransferRptDateSet(sqlWhere, warehouseTransferRptQueryEntity, this.pubParasInfo, this.dataBaseID[0]);
        }

        public DataSet GetWorkClassRptDataSet(WorkClassRptQueryEntity workClassRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(workClassRptQueryEntity.WORK_CLASS_ID))
            {
                sqlWhere.Add(" A.WORK_CLASS_ID " + workClassRptQueryEntity.WORK_CLASS_ID);
            }
            if (!string.IsNullOrEmpty(workClassRptQueryEntity.FORKLIFT_DRIVER))
            {
                sqlWhere.Add(" A.FORKLIFT_DRIVER " + workClassRptQueryEntity.FORKLIFT_DRIVER);
            }
            if (!string.IsNullOrEmpty(workClassRptQueryEntity.DOC_TYPE))
            {
                sqlWhere.Add(" A.DOC_TYPE " + workClassRptQueryEntity.DOC_TYPE);
            }
            if (!string.IsNullOrEmpty(workClassRptQueryEntity.WORK_TYPE))
            {
                sqlWhere.Add(" A.WORK_TYPE " + workClassRptQueryEntity.WORK_TYPE);
            }
            if (!string.IsNullOrEmpty(workClassRptQueryEntity.IS_HOLIDAY))
            {
                sqlWhere.Add(" A.IS_HOLIDAY " + workClassRptQueryEntity.IS_HOLIDAY);
            }
            if (!string.IsNullOrEmpty(workClassRptQueryEntity.StartDateTime))
            {
                sqlWhere.Add(" A.CREATED_DATE >= '" + Convert.ToDateTime(workClassRptQueryEntity.StartDateTime).ToString("yyyy-MM-dd") + " 00:00:00'");
            }
            if (!string.IsNullOrEmpty(workClassRptQueryEntity.EndDateTime))
            {
                sqlWhere.Add(" A.CREATED_DATE <= '" + Convert.ToDateTime(workClassRptQueryEntity.EndDateTime).ToString("yyyy-MM-dd") + " 23:59:59'");
            }
            return analyticsReportDA.GetWorkClassRptDataSet(sqlWhere, workClassRptQueryEntity, this.dataBaseID[0], this.pubParasInfo);
        }

        public DataSet GlobalInventoryWithWHRptDataSet(GlobalInventoryWithWHRptQueryEntity globalInventoryWithWHRptQueryEntity)
        {
            List<string> sqlWhere = new List<string>();
            if (!string.IsNullOrEmpty(globalInventoryWithWHRptQueryEntity.SKU_ID))
            {
                sqlWhere.Add(" A.SKU_ID " + globalInventoryWithWHRptQueryEntity.SKU_ID);
            }
            if (!string.IsNullOrEmpty(globalInventoryWithWHRptQueryEntity.OWNER_ID))
            {
                sqlWhere.Add(" A.OWNER_ID " + globalInventoryWithWHRptQueryEntity.OWNER_ID);
            }
            if (!string.IsNullOrEmpty(globalInventoryWithWHRptQueryEntity.SKU_CLASS_ID))
            {
                sqlWhere.Add(" B.SKU_CLASS_ID " + globalInventoryWithWHRptQueryEntity.SKU_CLASS_ID);
            }
            if (!string.IsNullOrEmpty(globalInventoryWithWHRptQueryEntity.VENDOR_ID))
            {
                sqlWhere.Add(" E.VENDOR_ID " + globalInventoryWithWHRptQueryEntity.VENDOR_ID);
            }
            if (!string.IsNullOrEmpty(globalInventoryWithWHRptQueryEntity.VENDOR_ID))
            {
                sqlWhere.Add(" E.VENDOR_ID " + globalInventoryWithWHRptQueryEntity.VENDOR_ID);
            }
            if (!string.IsNullOrEmpty(globalInventoryWithWHRptQueryEntity.EXTENAL_LOT))
            {
                sqlWhere.Add(" E.EXTERNAL_LOT " + globalInventoryWithWHRptQueryEntity.EXTENAL_LOT);
            }
            sqlWhere.Add(" A.QTY >0 ");
            return analyticsReportDA.GlobalInventoryWithWHRptDataSet(sqlWhere, globalInventoryWithWHRptQueryEntity, globalInventoryWithWHRptQueryEntity.WhID, this.pubParasInfo);
        }
    }
}

